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 End Tag

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Goto End Tag

XML.GEnd

Goto nearest End-Tag

 

 

Intention

 

This command will set actual position to the nearest </xxx > End-Tag. It will jump over Tags that are self terminated.

 

The found End-Tag is just the "<" open bracket od the nearest End-Tag that is nearest to the current position.

 

Usage:

 

XML.GEnd|$$END

 

or

 

' We give the starting Position, that should be corrected to

' the start-position of the nearest End-Tag.

VAR.$$STA=199

XML.GEnd|$$END|$$STA

 

Hint:

If you need the End-Tag of your current Tag, use

XML.gbl|$$STA|$$END

instead. You will have the End-Tag Position in $$END.

 

 

 

 

Syntax

 

 

XML.Goto End Tag[|P2][|P3]

 

 

 

Parameter Explanation

 

P2 - (optional) Variable to return the result. The result is 0 in case of parsing errors.

          Otherwise the result is >0 and contains the position of the End-Tag of our

          current positions start-tag.

 

P3 - (optional) Numeric value that is taken as the start-tag position.

          If omitted, current position is used.

 

 

 

Example

 

'***********************************

'

'***********************************

'Prototype für IML.

$$PRO=Open Bracket

$$TXT=a real Open Bracket

$$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.gend|$$BSE

PRT.Current Block starts at: $$POS

PRT.Current Block ends at: $$BSE

XML.gxp|$$POS|$$BSE|$$BLO

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

PRT. This is the Block:

PRT.$$BLO

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

PRT. We Dump Positions

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

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

XML.Dump|($$BSE-3)|($$BSE+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

  gend - Goto End Tag

  gst - Goto Start Tag

  gse - Get Start End Tags

  gbl - Get Block