<< Click to Display Table of Contents >> Navigation: 3. Script Language > XML-Parser > XML. - after parse > XML-Parser * XML. (after Parse) |
MiniRobotLanguage (MRL)
XML.Position to Start or End Tag
XML.ptse
Get or change current position to nearest Start- or End-Tag
Intention
This command is used to locate the nearest Start- or End-Tag to the actual position.
It will change the actual position, and it will return the found Tag-Position,
if you specify P2.
If you specify P3, then P3 will be taken instead of the actual position.
If the actual position is already on a Start-Tag or End-Tag, the position will not be changed.
XML.ptse
or
XML.ptse|$$POS
In the second sample, the variable $$POS will return the new position or the unchanged position, if we are already on a start-Tag.
If you specify P3 like this;
XML.ptse|$$POS|$$NPO
then P3 will be used, instead of the actual position.
Syntax
XML.ptse[|P2][|P3]
Parameter Explanation
P2 - (optional) Variable to return the result. The result is >0 and contains the
actual position that is on a Start-Tag.
If omitted, the result is been placed on TOS
P3 - (optional) numeric Byte address of the XML-Data Byte that
should be taken as position. If P3 is given, the result in P2 is the "corrected"
value from P3 on teh nearest Start-Tag in upward direction (previous)..
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.sdn|&EXACT:Patch
XML.get pos|$$POS
PRT.Actual Position is: $$POS
XML.gse|$$BSA|$$BSE
PRT.Current Block starts at: $$BSA
PRT.Current Block ends at: $$BSE
XML.ptse|$$BAA|$$BSA
PRT. Using ptse on $$BSA -> $$BAA
XML.ptse|$$BAB|$$BSE
PRT. Using ptse on $$BSE -> $$BAB
PRT.------------------------
PRT. We Dump Positions
XML.Dump|($$BAA-3)|($$BAA+3)
PRT.------------------------
XML.Dump|($$BAB-3)|($$BAB+3)
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