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.Increment Position

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Increment Position

XML.inc pos

Get XML-Data from a file

 

 

Intention

 

This command is used to change the internal "actual position Pointer". It will increment this pointer by 1. If P2 is given, the actual position will be incremented by the number in P2.

 

Immediately after parsing, the actual position is at the Root of the Document.

After any successful search, the actual position is at the start tag of the found tag.

 

To find out the actual position, you can use the gpo - Get Position  command.

To set the position to another value you can use the spo - Set Position command.

 

 

 

 

Syntax

 

 

XML.Increment Position[|P2]

 

 

 

Parameter Explanation

 

P2 - (optional) Variable or numeric parameter, that is incremented from

          current position. If omitted, 1 is used.

 

 

 

Example

 

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

'

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

'Prototype für IML.

$$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

XML.get len|$$LEN

PRT.Actual Size of (and maximum position)

PRT. of the XML-Data is: $$LEN

'Here we start

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

XML.inc pos

GSB. pos

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

XML.sdn|{&EXACT:Product}

GSB.pos

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

XML.dec pos

GSB. pos

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

MBX.!

:enx

ENR.

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

:pos

XML.get pos|$$POS

PRT.Actual Position is: $$POS

RET.

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

' Error Handler

:Lab_Err

XML.get error|$$ERT

DBP.$$ERT

ENR.

 

This is the result of the sample script:

 

graphic

 

 

 

 

Remarks

 

You can not Increment the actual position to values that are outside of the current loaded XML-File. The command will prevent this internally. The valid values range from 1 to XML-Length.

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var

  gpo - Get Position

  gpr - Get Position for Previous

  spo - Set Position

  dec pos - Decrement Position