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



<@ELEMENTATTRIBUTE>

Syntax

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

Description

This tag is used to return the value of one or more attributes 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 value of the attribute defined by NAME. If more than one element is pointed to, and those elements have the attribute defined in ATTRIBUTE, 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>

<@ELEMENTATTRIBUTE OBJECT="myDom" ATTRIBUTE="ID" ELEMENT="root().child(1).child(all)"> returns an array consisting of the two ID values:


a111


b222

<@ELEMENTATTRIBUTE OBJECT="myDom" ATTRIBUTE="CLASS" ELEMENT="root().child(1).child(2)"> returns a single value:

different

See Also

<@DOM>
<@DOMDELETE>
<@DOMINSERT>
<@DOMREPLACE>
<@ELEMENTATTRIBUTES>
<@ELEMENTNAME>
<@ELEMENTVALUE>



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



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.