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

<@DOMINSERT>

Syntax

<@DOMINSERT OBJECT=variable [SCOPE=scope] [ELEMENT=Xpointer] [POSITION=append|before|after]>
...XML goes here...</@DOMINSERT>

Description

This tag is used to insert XML into a document instance. The OBJECT attribute (and optional SCOPE attribute) defines the variable which contains the document instance. The ELEMENT attribute points to an XML element in the document instance. If the ELEMENT attribute is omitted, the root element of the document is used.

Depending on the value of the POSITION attribute, the XML between the start and end tags of <@DOMINSERT> is either appended to, put before (that is, a preceding sister), or put after (a following sister) the element specified in ELEMENT. The default is append.

For more information on the use of <@DOM...> meta tags, see Chapter 9 of the User's Guide.

If the specified variable does not exist, a new variable is created.

Example

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

<XML><DIV>
<P>Paragraph 1</P>
<P>Paragraph 2</P>
</DIV>
</XML>

<@DOMINSERT OBJECT="myDom" ELEMENT="child(1)" POSITION=append><P>Paragraph 3</P></@DOMINSERT>

The preceding tag appends the XML between the DOMINSERT tags (<P>Paragraph 3</P>) to the child(1) element (that is, <DIV>). The POSITION attribute is optional in this case, because the default action is to append the XML to the specified element. This results in the following structure:

<XML><DIV>
<P>Paragraph 1</P>
<P>Paragraph 2</P>
<P>Paragraph 3</P>
</DIV></XML>

The following inserts the specified XML as a preceding sister of the first paragraph:

<@DOMINSERT OBJECT="myDom" ELEMENT="child(1).child(1)" POSITION=before><P>Paragraph 3</P></@DOMINSERT>

This results in the following structure:

<XML><DIV>
<P>Paragraph 3</P>
<P>Paragraph 1</P>
<P>Paragraph 2</P>
</DIV></XML>

See Also

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



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

docs@pervasive.com
Copyright © 1999, Pervasive Software. All rights reserved.