XML-Parser * XML. (after Parse)

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > XML-Parser > XML. - after parse >

XML-Parser * XML. (after Parse)

XML.Goto Start Tag

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Goto Start Tag

XML.gst

Move actual Position to nearest upward Start-Tag

 

 

Intention

 

This command is used to change the actual position to the nearest Start-Tag in upward direction.If the actual position is already on a Start-Tag, the position will not be changed.

 

XML.gst

 

or

 

XML.gst|$$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.gst|$$POS|$$NPO

 

then P3 will be used, instead of the actual position.

 

 

 

Syntax

 

 

XML.Goto Start Tag[|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.gst|$$BAA|$$BSA

PRT. Using gst on $$BSA -> $$BAA

XML.gst|$$BAB|$$BSE

PRT. Using gst on $$BSE -> $$BAB

PRT.------------------------

PRT. We Dump Positions

XML.Dump|($$POS-3)|($$POS+3)

PRT.------------------------

XML.Dump|($$POB-3)|($$POB+3)

 

MBX.!

:enx

ENR.

'-----------------------------------------------------------

' Error Handler

:Lab_Err

XML.get error|$$ERT

DBP.$$ERT

ENR.

ENR.

 

This is the result of the sample script:

 

graphic

 

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var