Adobe 65036570 - Director - PC User Manual page 416

User guide
Hide thumbs Also See for 65036570 - Director - PC:
Table of Contents

Advertisement

Node Script
Return value if an element
String representing the name of the
attributeName[N]
Nth attribute.
(N is an integer)
is returned if no Nth attribute
VOID
exists or there is a script error.
String representing the value of the
attributeValue[N
]
Nth attribute.
(N is an integer)
is returned if no Nth attribute
VOID
exists or there is a script error.
String representing the value of the
attributeValue[N
]
attribute with the name N.
(N is a string)
is returned if the node does not
VOID
have an attribute named N or there is a
script error.
text
VOID
Note: The subfield
exists for any field that is accessible with bracket access. You can specify
count
whichNode.child.count
Using this XML document as a starting point, the following examples demonstrate how to use these script terms to
access the data within various node levels of the XML structure.
The XML looks like the following example:
<?xml version="1.0"?>
<e1>
<tagName attr1="val1" attr2="val2"/>
<e2>element 2</e2>
<e3>element 3</e3>
Here is some text
</e1>
The following script returns the name of the first XML tag:
put gParserObject.child[1].name
-- "e1"
The
variable contains the parsed XML. When used in the preceding script, it refers to the root node
gParserObject
of the XML document. The script term
To find out what kind of node the first tag is, use the
put gParserObject.child[1].type
-- #element
To refer to the nodes that are nested more than one level deep, use more than one level of child reference. The
following script returns the name of the first tag that is nested within the
put gParserObject.child[1].child[1].name
-- "tagName"
The following script returns the name of the second tag that is nested within the
put gParserObject.child[1].child[2].name
-- "e2"
to find how many children are in the specified node.
refers to the first level of nested tag, which is the
child[1]
Return value if text
Return value if Processing
Instruction
VOID
VOID
VOID
VOID
VOID
VOID
String representing
String representing the data
the character data
section of the processing
contained in this node.
instruction.
method, as shown in the following example:
type
tag:
e1
ADOBE DIRECTOR 11.0
tag.
e1
tag:
e1
405
User Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director 11

Table of Contents