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.Set Chr

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.Set Chr

XML.scr

Change a Byte in the XML-Data to a specified Character

 

 

Intention

 

This command is used to change a Single Character inside the XML-Data to a specified other character.

You may need a Reparse, if this change will influence the XML-Structure.

Reparse is done using: rpa - Reparse

 

' These lines are doing the same thing:

' as 62=ASCII of ">"

XML.scr|$$BSA|>

XML.ssc|$$BSA|62

 

Hints:

To specify an ASCII Value instead of a CHaracter, use:

ssc - Set Asc

 

To replace whole words or Data-Blocks, use

sxp - Set XML Part

 

 

 

Syntax

 

 

XML.Set Chr|P2[|P3]

 

 

 

Parameter Explanation

 

P2 - (optional) numeric Byte  address of the XML-Data Byte that

          should be taken as position. If zero, the actual position is taken.

 

P3 - (optional) Variable with just one character that is been placed inside the

          XML-Data at the position which is specified in P2.

 

 

 

Example

 

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

'

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

'

$$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.sdn|&EXACT:SURLS

XML.get pos|$$POS

PRT.Actual Position is: $$POS

XML.gbl|$$BSA|$$BSE

PRT.Current Block starts at: $$BSA

PRT.Current Block ends at: $$BSE

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

PRT.This is the block before change:

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

XML.Print

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

PRT.Now we use Set-XML-Part to change the block

$$TXT=!!!!!!!! New Block-Text !!!!!!!!!!

XML.sxp|$$BSA|$$BSE|$$TXT

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

XML.Print

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

PRT. In this case the Reparse was done internally.

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

PRT.Now we will make a character change in the XML-Data

XML.scr|$$BSA|>

XML.ReParse

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

XML.Print

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

PRT. We Dump Positions

XML.Dump|($$BSA-3)|($$BSA+3)

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

XML.Dump|($$BSB-3)|($$BSB+3)

 

MBX.!

:enx

ENR.

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

' Error Handler

:Lab_Err

XML.get error|$$ERT

DBP.$$ERT

ENR.

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

  gsc - Get Asc

  rpa - Reparse

    ssc - Set Asc

  sxp - Set XML Part