|
|
|
|
|
XMLRead (Function) In french: XMLLit Returns the value of an XML element or the value of the attribute for an XML element.
MonDoc is string = fLoadText("exemple.xml")
XMLDocument("DOM", MonDoc)
sNomFonction is string = XMLRead("DOM","/Exemple/Aide/Fonction")
sTypeFonction is string = XMLRead("DOM","Aide/Fonction/@type")
sNomFonction2 is string = XMLRead("DOM","Aide/Fonction[2]")
sImage is string = XMLRead("DOM","Aide[2]/@image")
sTypeImage is string = XMLRead("DOM","/Exemple/Aide[@image=""trait.jpg""]/@format", "NonDefini")
XMLClose("DOM")
Syntax
<Result> = XMLRead(<XML document> , <Path of the element to be read> [, <Not found>])
<Result>: Character string - Value of element or value of attribute,
- Empty string ("") or value of <Not found> parameter in the following cases:
- if the element was not found.
- if the element has no value
- if the XPath query is not a query for selecting records.
In this case, the ErrorOccurred variable is set to True and ErrorInfo returns more details about the error.
<XML document>: Character string Name of XML document where the reading will be performed. This document contains the XML code to study and it was created by XMLDocument. <Path of the element to be read>: Character string Can correspond to:- the path of the value to read in the XML file. Please note: case is taken into account (upper and lower case).. To read the value of an attribute, the name of the attribute must be preceded by the "@" character.
- the text of an XPath query to run. The XPath query must be a query for "selecting records". If several elements match the selection, the first element found is used.
If this path does not start with "/", the name of the root node is automatically added. If the XML document has no root, <Result> will correspond to <Not found>. <Not found>: Optional character string Text to return if the element was not found. This parameter corresponds to an empty string ("") by default. Remarks Special cases - XMLRead does not modify the current position in the document.
- Several XML browse queries cannot be nested.
- XMLRead must not be used with an XMLDocument variable. To read the content of an XMLDocument variable, use the "FOR EACH" syntax.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|