PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Properties specific to the description of xpathResult variables
  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
xpathResult (Type of variable)
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: See Declaring a variable for more details.
Example
myXPath is xpathResult
myDoc is xmlDocument = XMLOpen("MyDoc.xml")
myXPath = XMLExecuteXPath(myDoc, "/Root/child")
FOR EACH xmlMyChild OF myXPath..Node
Trace(xmlMyChild..Text)
END
clDoc is xmlDocument = XMLOpen(n, fromString)
c is xpathResult = XMLExecuteXPath(clDoc, "/root")
IF c..IsValue THEN
Trace(c..Value)
ELSE
FOR EACH node OF c..Node
Trace("Node: " + node..Text)
END
FOR EACH attrib OF c..Attribute
Trace("Node: " + attrib..Name)
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 node OF c..Node
Trace("Node: " + node..Text)
END
FOR EACH attrib OF c..Attribute
Trace("Node: " + attrib..Name)
END
END
Remarks

Properties specific to the description of xpathResult variables

The following properties can be used to handle the result of an XPATH query:
Property nameType usedEffect
AttributeArray of xmlAttributeList of attributes returned by the XPath query.
IsValueBoolean
  • True if the XPath result is a value,
  • False if the XPath result is a set of nodes and/or attributes.
NodeArray of xmlNodeList of nodes returned by the XPath query.
ValueAll typesValue returned if the query returns an integer, boolean or text value. This value can correspond to a string, a boolean or a real.
Note: These properties can be handled by using one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>

Various

  • The list of nodes is not sorted.
  • The standard used for the XPath query is XPath 1.0.
Minimum required version
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment