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 DQ

Previous Top Next


MiniRobotLanguage (MRL)

 

IML.Between DQ

IML.bdq

IML.Between DQZ

IML.bdqz

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 part of an attribute and is "between Double Quotes" or not.

You can also scan for the first byte that is outside of these double quotes (DQ).

DQ inside an attribute value that is delimited using SQ are not real DQ and are therefore not flagged.

 

' Here is an example:

' These DQ's will not be flagged

' also the "=" after "Liste" will not be flagged

<Hallo first='Liste="1234'"ok'>

 

' These DQ's will be flagged

<Hallo first="Liste='1234'ok">

 

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

 PRT. Pos. 30 is flagged.

EIF.

 

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

IML.bdq|30

 PRT. Pos. 30 is between DQ's

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.bdq|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.bdqz|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 DQ[|P2][|P3]

IML.bdq[|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

 

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

$$PRO=Between DQ

$$TXT=Between Double Quotes

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

 PRT. Pos. 30 is "$$TXT".

EIF.

IML.$$PRO|21

 PRT. Pos. 21 is "$$TXT".

ELS.

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

EIF.

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

IML.$$PRO|20|40

 $$ERG=$$000

 PRT. Pos. $$ERG is "$$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|20|($$RES+10)

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