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.Get Start End Tags

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Get Start End Tags

XML.gse

Get Stat-/End-Tag position of actual Position's Tag

 

 

Intention

 

This command is used to get the Start- and End-Position of the XML-Data Block at the actual position. Thhs command will return the Start- and End-Tag that corresponds together.

 

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 Characters of the XML-Data. This command is very useful if you want to retrieve a complete part of the XML-Data.

 

See also gbl - Get Block to retrieve directly the content inside the Start- and End-Tags..

 

 

 

Syntax

 

 

XML.Get Start End Tags[|P2][|P3]

 

 

 

Parameter Explanation

 

 

P2 - (optional) Variable to return the start-byte of the Tag.

P3 - (optional) Variable to return the end-byte of the Tag.

 

 

 

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.gse|$$STA|$$END

PRT.Start-Tag Position is: $$STA

PRT.End-Tag Position is: $$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:

 

graphic

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var

  gbl - Get Bloc

  gxp - Get XML Part

  sxp - Set XML Part

  sdn - Search Down Tag Name

  mst - My Start Tag