<< Click to Display Table of Contents >> Navigation: 3. Script Language > XML-Parser > XML. - after parse > XML-Parser * XML. (after Parse) |
MiniRobotLanguage (MRL)
XML.My Start Tag
XML.mst
Get the Start-Tag from the Tag at actual position
Intention
This command is used to set actual position to the Start-Tag of the actual End-Tag.
This command will return the Start-Tag that corresponds with the actual located End-Tag.
Example:
<Tag_A>
<Tag_B>
Content
</Tag_B>
</Tag_A>
If we are in </Tag_A> then we will get the position of the bold marked Character <Tag_A> from the Start-Tag .
See also gbl - Get Block to retrieve directly the content inside the Start- and End-Tags..
See also gse - Get Start End Tags if you want both Tags with one command.
Syntax
XML.My Start Tag[|P2]
Parameter Explanation
P2 - (optional) Variable to return the result. If nothing is found, the variable will be 0.
If omitted, the result will also be placed on TOS. The actual position will be
changed, if something was found.
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
' We get the "actual position" - after parsing.
XML.get pos|$$POS
PRT.Actual Position after Parsing is: $$POS
PRT.------------------------
XML.goto first node
' We use a Hi-Level Search here.
XML.sdn|SURLS
XML.get pos|$$POS
PRT.Actual Position after search is: $$POS
PRT.------------------------
XML.mst|$$STA
XML.met|$$END
PRT.Start-Tag Position is: $$STA
PRT.End-Tag Position is: $$END
PRT.------------------------
PRT. We are going to Dump these Bytes
XML.Dump|$$STA-1|($$STA+6)
PRT.------------------------
PRT. We are going to Dump these Bytes
XML.Dump|$$END-1|($$END+6)
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
•