XML-Parser * XML. (no Parse needed)

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > XML-Parser > XML - no parse >

XML-Parser * XML. (no Parse needed)

XML.UnClean Text

Previous Top Next


MiniRobotLanguage (MRL)

 

XML.UnClean Text

XML.UnClean

Prepare Textual Data for inclusion in XML-Documents

 

 

Intention

 

This There are special characters that are not valid inside XML-Documents, because they have a special meaning. You find them below.

 

In XML-Files, we have data that is enclosed and described using "tags".

We have "Start-Tags" like <note>

and we have "End-Tags" like </note>

between these we have data that can itself be XML or other data.

 

Because of this, there are some characters that should not be used in the XML-data,

because they are reserved for tags. These characters are:

 

& - should be replace by &amp;

< - should be replace with &lt;

> - should be replace with &gt;

" - should be replace with &quot;

' - should be replace with &spos;

 

For this purpose the XML. command has the "Clean"-Option.

 

It will prepare your data to be valid as XML-Data.

 

And if you want your data back to the original state, just use the "unclean" option.

 

Here is an example:

 

' Prepare Data for use in XML-Files

$$XMD=>&XMLData>&<<>

XML.clean|$$XMD|$$XMO

DBP. the ready for use XML-Data is in $$XMO

$$XMD=

XML.unclean|$$XMO|$$XMD

DBP.$$XMD contains the original data

END.

 

 

 

 

Syntax

 

 

XML.UnClean Text|P2[|P3]

 

 

 

Parameter Explanation

 

P2 - Variable with XML-Data that is going to be cleaned.

P3 - Variable to return the result. If omitted the result is placed on TOS.

 

 

 

Example

 

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

' XML.-Clean/UnClean Sample

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

'

$$XMF=My current <XML\> is &new

' Now we are going to parse it

XML.Clean|$$XMF|$$XMC

XML.UnClean|$$XMC|$$XMU

PRT.Original:    $$XMF

PRT.After CLean: $$XMC

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

PRT.UnCLeaned:   $$XMU

MBX.!

ENR.

 

This is the result of the sample script:

 

graphic

 

 

 

Remarks

 

Unlike other commands, XML.Clean and XML.UnCLean can be used without the need to first parse or load an XML-File. They are basically String/Text Replace-Operations.

 

 

 

Limitations:

 

-

 

 

See also:

 

  ! Smart Package Robot 's XML-Features

  ! SPR - XML-Parser Flags

  XML. - eXtended Markup Language

  par - parse from var

  clean - Clean Text