PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • 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/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Versions 27 and later
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android Widget mode.
New in version 27
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Example
monXPath is xpathResult
monDoc is xmlDocument = XMLOpen("MonDoc.xml")
monXPath = XMLExécuteXPath(monDoc, "/Root/fils")
FOR EACH xmlMonFils OF monXPath.Node
Trace(xmlMonFils..Text)
END
clDoc is xmlDocument = XMLOpen(n, fromString)
c is xpathResult = XMLExécuteXPath(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 = XMLExécuteXPath(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
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.

Various

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