XML document

Top  Previous  Next

Examples > XML > XML document

 

The start rule for the XML parser is: document. After you have parsed the start rule as usual by

 

parse_context

 

not all names in the syntax tree are preceded by a square to open the structure of the production.

 

XML_unparsed

 

The reason is, that the XML grammar consists of two overlapping parts:

 

the part for the real document and
the part for a DTD (document type definition), which is written in an external file and defines tags and attributes for the document

 

Many XML documents don't need external DTD's and here only the first part shall be examined. The other rules have remained for interested user in the project.

 

At first glance both the grammar and the document appear quite confusing.

The TextTransformer project can help, to make them clearer. The structure can be shown in the variable-inspector. For this a node breakpoint is set on an action at the end of the start rule.

 

 

XML_breakpoint_en

 

Now you can execute the program up to the breakpoint

 

runbtn

 

and open the variable inspector.

 

VarInspectorButton

 

Now choose to view the local variables:

 

XML_localvars_en

 

and double click on the value side on one of the nDoc-lines.

 

XML_collapsedtree_en

 

The result is a tree view of the XML document.

 

 

 

 

 

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German