[TOC] [Prev] [Next] [Bottom]



<@ELEMENTNAME>

Syntax

<@ELEMENTNAME OBJECT=variable [SCOPE=scope] [ELEMENT=Xpointer] [TYPE=text|array] [{array attributes}]>

Description

This tag is used to return an element name or names from a document instance. The OBJECT attribute defines the document instance variable. The SCOPE attribute defines the scope of that document instance variable.

The ELEMENT attribute contains a pointer to an element or elements within the document instance.

The value returned is the name of the element or elements pointed to. If more than one element is pointed to, several values may be returned as an array.

There are array-returning attributes that can be used to specify prefixes and suffixes for the returned array, rows within the array, and columns within the rows. They are described in the section Array-to-Text Conversion Attributes. By default, the returned array is formatted as an HTML table.

If the TYPE attribute is set to TEXT, a returned array is not passed as an array reference when assigning to another variable, but as a text representation of the array, which is returned by default with the array-formatting attributes.

For more information on returning values from a document instance, see Chapter 9 of the User's Guide.

Example

Starting with the following document instance in a variable called myDom:

<XML><DIV>
<P ID=a111 CLASS=normal>Paragraph 1</P>
<P ID=b222 CLASS=different>Paragraph 2</P>
</DIV></XML>

<@ELEMENTNAME OBJECT="myDom" ELEMENT="root().child(1).child(all)"> returns a one-dimensional array consisting of both element names:


P


P

<@ELEMENTNAME OBJECT="myDom" ELEMENT="root().child(1).child(2)"> returns the element name:

P

See Also

Array-to-Text Conversion Attributes
<@DOM>
<@DOMDELETE>
<@DOMINSERT>
<@DOMREPLACE>
<@ELEMENTATTRIBUTE>
<@ELEMENTATTRIBUTES>
<@ELEMENTVALUE>



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.