|
|
|
|
|
- Properties specific to xpathResult variables
- Miscellaneous
xpathResult (Variable type) In french: xpathRésultat
The xpathResult type is used it find out the result of the execution of an XPATH query. The characteristics of this result are returned by several WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
monXPath is xpathResult
monDoc is xmlDocument = XMLOpen("MonDoc.xml")
monXPath = XMLExecuteXPath(monDoc, "/Root/fils")
FOR EACH xmlMonFils OF monXPath.Node
Trace(xmlMonFils..Text)
END
clDoc is xmlDocument = XMLOpen(n, fromString)
c is xpathResult = XMLExecuteXPath(clDoc, "/root")
IF c.IsValue THEN
Trace(c.Value)
ELSE
FOR EACH MonNoeud OF c.Node
Trace("Noeud : " + MonNoeud..Text)
END
FOR EACH attrib OF c.Attribute
Trace("Noeud : " + attrib.Nom)
END
END
clDoc is xmlDocument = XMLOpen(n, fromString)
c is xpathResult = XMLExecuteXPath(clDoc, "/root/text()")
IF c.IsValue THEN
Trace(c.Value)
ELSE
FOR EACH noeud OF c.Node
Trace("Noeud : " + noeud..Text)
END
FOR EACH attrib OF c.Attribute
Trace("Noeud : " + attrib.Nom)
END
END
Properties Properties specific to xpathResult variables The following properties can be used to handle the result of an XPATH query: | | | Property name | Type used | Effect |
---|
Attribute | Array of xmlAttribute | List of attributes returned by the XPath query. | IsValue | Boolean | - True if the XPath result is a value,
- False if the XPath result is a set of nodes and/or attributes.
| Node | Array of xmlNode | List of nodes returned by the XPath query. | Value | All types | Value returned if the query returns an integer, boolean or text value. This value can correspond to a string, a boolean or a real. |
Remarks Miscellaneous - The list of nodes is not sorted.
- The standard used for the XPath query is XPath 1.0.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|