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



<@ELEMENTVALUE>

Syntax

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

Description

This tag is used to return an element value or values 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 element or elements pointed to. Other elements that are children of the element are not considered to be content, and are not returned. 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.

If the specified element has no text content (that is, it is empty, or it contains other elements) then this tag returns an empty string.

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>

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


Paragraph 1


Paragraph 2

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

Paragraph 2

See Also

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



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



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.