<< Click to Display Table of Contents >> Navigation: 3. Script Language > XML-Parser > XML. - after parse > XML-Parser * XML. (after Parse) |
MiniRobotLanguage (MRL)
XML.Get Level
XML.glev
Get XML-Nesting Level
Intention
This command is used to retrieve the nesting level of any position in the XML-File.
Note that Self-Terminating Tags do not increase or decrease the nesting level.
' Example for nesting Level.
<Level 0>
<Level 1>
<Level 2>
<Level 2>
<Level 1>
<Level 0>
You can see the nesting Level in the XML-Data Dump, behind the "L:" :
Syntax
XML.Get Level[|P2][|P3]
Parameter Explanation
P2 - (optional) numeric Byte address of the XML-Data Byte from which
you want the nesting Level.
P3 - (optional) Variable for the textual result.
If omitted, teh result is been placed on TOS.
Example
'***********************************
'
'***********************************
'
$$XMF=?pfad\Small_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
XML.Set Pos|357
' We get the "actual position" - after parsing.
XML.get pos|$$POS
PRT.Actual Position after Parsing is: $$POS
' Hier gehts los
PRT.------------------------
XML.gLev
$$TXT=$$000
PRT.Actual Level are: $$TXT
PRT.------------------------
XML.gLev|($$POS+1)|$$ERG
PRT.Actual Level: $$ERG
PRT.------------------------
XML.Dump|($$POS-3)|($$POS+3)
PRT.------------------------
MBX.!
:enx
ENR.
'-----------------------------------------------------------
' Error Handler
:Lab_Err
XML.get error|$$ERT
DBP.$$ERT
ENR.
This is the result of the sample script:
Remarks
-
Limitations:
-
See also:
• ! Smart Package Robot 's XML-Features
• XML. - eXtended Markup Language