Class XmlWriter
java.lang.Object
org.libxmq.imp.ixml.earley.XmlWriter
Serialize a parse tree into an xml document, following the ixml marks:
- ^ (or no mark) a rule becomes an element, with its content inside.
- @ a rule becomes an attribute of the nearest element, its value is the
text of everything inside it.
- - a hidden rule, its content goes directly into its parent.
A hidden terminal, -'x', is dropped.
The mark of a call wins over the mark of the rule. Inside an attribute
every rule is hidden, only the text counts. Insertions add their text.
An element must not get the same attribute twice, that is the ixml dynamic
error D02.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA dynamic error, eg D02, found when serializing. -
Field Summary
Fields -
Method Summary
-
Field Details
-
IXML_NS
-
-
Method Details
-
toXml
Serialize the tree of the start rule.- Parameters:
tree- the tree from TreeBuildergrammar- the grammar- Returns:
- the document
- Throws:
XmlWriter.DynamicError- on a dynamic error, eg D02
-