XML Script logo
Command _parse
Attribute

escape, a string, defaults to 'yes'

[optional] whether to escape automatically any unusual characters found in the pattern, yes|no.

Attribute

text, a pointer(s)

[required] the element which contains the text to be parsed.

Attribute

pattern, a pointer(s)

[required] the element which describes the parsing pattern to be applied to the text.

Description

Generates template variables (either attributes or elements) from a piece of text. The tag applies 'pattern' to 'text' and uses it to identify characters which will be stored as variables. The parsing pattern will be a series of markers separated by interpolations. The tag searches for these markers in the text, and characters which fall between markers will be assigned to the variables defined by the interpolations. If the interpolations are invalid pointers (for instance, an interpolation can be turned into a comment by the addition of pairs of double bangs or shrieks) the characters assigned to that interpolation will be discarded. Because some characters (for instance, the square bracket) have a special meaning to the processor, the tag automatically escapes these characters (by pre-pending a backslash) when it finds them in the pattern string. This will generally avoid the need to include escape characters in the pattern. However, this feature can be switched off by setting the 'escape' attribute to 'no'. Note that the source text can be included either as the content of a sub-element, called <text />, or as a separate element to which the .text attribute is a pointer. The pattern may be defined in the same way.

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited