<< Click to Display Table of Contents >> Navigation: 3. Script Language > XML-Parser > XML. - after parse > XML-Parser * XML. (after Parse) |
MiniRobotLanguage (MRL)
XML.Search All Up
XML.sau
Search XML-Flags in upward direction
Intention
This command is used to search specified XML-Data Flags, starting from the actual position, in upward direction. You can use all these flags (See Link):
Usage:
XML.sau|start tag+open bracket+self terminate
XML.get pos|$$POA
PRT.Actual Position is: $$POA
XML.sau will always start from the actual position.
Syntax
XML.Search All Up|P2[|P3]
Parameter Explanation
P2 - numeric or textual Flag-Description. For Details see here:
P3 - (optional) Variable to return the result. The result is >0 and contains the
actual position that matched all of the specified flags.
If omitted, the result is been placed on TOS
Example
'***********************************
'
'***********************************
'
$$XMF=?pfad\SQ_XML.txt
NEF.$$XMF
MBX.File $$XMF was not found!
GTO.enx
EIF.
' Now we are going to parse it
XML.Load File|$$XMF
' We check if there are errors
JIT.Lab_Err
' We get the "actual position" - after parsing.
XML.get pos|$$POS
PRT.Actual Position after Parsing is: $$POS
' Hier gehts los
PRT.------------------------
XML.inc pos
XML.get pos|$$POA
PRT.Actual Position is: $$POA
PRT.------------------------
XML.sad|start tag+open bracket+self terminate
XML.get pos|$$POA
PRT.Actual Position is: $$POA
PRT.------------------------
XML.dec pos
XML.get pos|$$POA
PRT.Actual Position is: $$POA
PRT.------------------------
XML.sau|start tag
XML.get pos|$$POB
PRT.Actual Position is: $$POB
PRT.------------------------
PRT. We Dump Positions
XML.Dump|($$POA-3)|($$POA+3)
PRT.------------------------
XML.Dump|($$POB-3)|($$POB+3)
MBX.!
:enx
ENR.
'-----------------------------------------------------------
' Error Handler
:Lab_Err
XML.get error|$$ERT
DBP.$$ERT
ENR.
This is the result of the sample script:
Here is the important part of the used XML-Data that is analyzed here:
<?xml version="1.0" encoding="UTF-8"?>
<!-- comment attrib="Hall"-->
<PatchInformation XMLVersion="1.0000.0000.4918"
You can find the XML-Sample-Data file in the Installation folder in the Samples-Folder "XML".
Remarks
-
Limitations:
-
See also:
• ! Smart Package Robot 's XML-Features
• XML. - eXtended Markup Language