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 First Node

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Get First Node

XML.gfn

Get Position of first node in XML-Data

 

 

Intention

 

This command is used to move actual position to the fist "<" first node in the XML-Data.

If your XML-Data looks like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- comment attrib="Hall"-->

<PatchInformation XMLVersion="1."'>

<Products>

 

then the black marked < is the actual position after a call to "First node".

All System- and comment-Tags will be ignored.

 

It will return the found position as a result in P2 (if P2 is specified) or leave the address on the TOS.

 

 

 

Syntax

 

 

XML.Get First Node[|P2]

 

 

 

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 byte-address of the first node..

           

 

 

 

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.gfn

XML.get pos|$$POS

PRT.Actual Position is: $$POS

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

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

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

MBX.!

:enx

ENR.

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

' Error Handler

:Lab_Err

XML.get error|$$ERT

DBP.$$ERT

ENR.

 

This is the result of the sample script:

 

graphic

 

Here is the important part of the used XML-Data that is analyzed here:

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- comment attrib="Hall"-->

<PatchInformation XMLVersion="1.0000.0000.4918" XMLLastUpdated="1/30/2010" PatchCount="1261">

<Products>

 

You can find the XML-Sample-Data file in the Installation folder in the Samples-Folder "XML".

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var

  gtr - Goto Root

  gro - Get Root