XML-Parser * IML. / NML. (after Parse)

<< Click to Display Table of Contents >>

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

XML-Parser * IML. / NML. (after Parse)

IML./NML.Between

Previous Top Next


MiniRobotLanguage (MRL)

 

IML.Between

IML.btw

IML.BetweenZ

IML.btwz

Find out if the specified XML-Flag is set.

 

 

Intention

 

This command is used to analyze XML-Flags. Using this command, you can find out if the actual XML-Data-Byte is inside a Tag that is between < > or not.

 

To understand this better, see the XML-Sample-Data  and XML-Flags-Dump here:

! Sample-XML Data

 

There are 6 ways of using this command, depending on the number of Parameters.

 

' With no Parameter, IML. will use the current position

XML.Set Pos|30

IML.btw

 PRT. Pos. 30 flagged.

EIF.

 

' With 0ne parameter IML. will check just the given Byte

IML.btw|30

 PRT. Pos. 30 is flagged.

EIF.

 

' With two parameters, IML: will start searching for a Bate with

' the specified Flag set, and if one is found, place that

' Bytes Number on the TOS (Top of Stack).

IML.btw|20|40

 PRT. Pos. $$000 is flagged.

EIF.

 

Additionally you can suffixe in all three cases above the subcommand with a "z".

This will change the internal search to "Bit not set" (Z= Bit=Zero).

 

' Now we are scanning for "Bit not set"

IML.btwz|30|40

 PRT. Pos. $$000 is the first byte after that Flag is set.

EIF.

 

As always NML. is the negative Form of IML.

 

 

 

Syntax

 

 

IML.Between[|P2][|P3]

IML.btw[|P2][|P3]

 

 

 

Parameter Explanation

 

P2 - (optional) Variable with the Position, where to test the XML-Flag.

          If P3 is specified, then this is the Start-Byte to scan at.

          If the value in P3<P2 then the Scan is done in reverse order.

 

P3 - (optional) Variable with the ending position for the scan.

          If P3 is specified, then P3 is the End-Byte to scan.

          If the value in P3<P2 then the Scan is done in reverse order.

 

 

 

Example

 

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

'

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

'Prototype für IML.

$$PRO=Between

$$TXT=Between < >

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

' Hier gehts los

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

IML.$$PRO|1|500

 $$ERG=$$000

 PRT. Pos. $$ERG is "$$TXT".

EIF.

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

IML.$$PRO|$$ERG

 PRT. Pos. $$ERG is "$$TXT".

EIF.

IML.$$PRO|($$ERG+1)

 CAL.$$PLU=$$ERG+1

 PRT. Pos. $$PLU is "$$TXT".

ELS.

 PRT. Pos. $$PLU is NOT "$$TXT".

EIF.

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

' Now we are scanning for "Bit not set"

IML.$$PROz|$$ERG|($$ERG+50)

 $$RES=$$000

 PRT. Pos. $$RES is the first byte after "$$TXT".

EIF.

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

PRT. We are going to Dump 4 Bytes

XML.Dump|($$ERG-1)|($$RES+1)

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

 

This command needs the XML-Data to be parsed first, using the

par - parse from var

or the

lf - load file

Command. In this process the XML-Parser builds a Table with flags that is analyzed using this commands. You can see a XML-Dump of such XML-Data Flags here:

! Sample-XML Data

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var

  lf - load file

  stt - System Tag

  stn - Start Name

  stm - Self Terminate

  stg - Start Tag

  sta - Start Attribute

  osd - Outside SDQ

  obt - Open Bracket

  isq - Is SQ

  idq - Is DQ

  etg - End Tag

  edn - End Name

  eat - End Attribute

  cmt - Comment

  cbt - Close Bracket

  btw - Between

  bsq - Between SQ

  beq - Before EQ

  bdq - Between DQ

  afz - Any Flags Zero

  afs - Any Flags Set

  aeq - After EQ