Xml Syntax Definition

XT -- A Bundle of Program Transformation Tools
xml-tools contains a syntax definition in SDF for XML. This syntax defintion is not competely compatible with XML, but it tries to do the job as good as possible in a pure syntax definition.

The syntax definition should not be used for parsing XML files. This might sound odd, but for standard XML parsers do a much better job in terms of performance and standard compliance. The parse-xml-info tool supports parsing XML files with the standard XML parser of Java. So what is the use of the syntax definition? It can be used to embed XML in programming languages like Stratego and Java.

Besides the obvious constructs, the grammar supports entities, character references and namespaces.

Known problems:

  • Stratego.ATerm, SGLR, and SDF just support ASCII and therefore the grammar just supports ASCII. This will not change until SGLR and SDF supports Unicode.

  • DTD declarations in XML files are not supported. The DTD grammar is work in progress. Maybe DTD constructs in XML documents will be supported when this grammar is stable. External document type declarations (DOCTYPE) are supported.

-- MartinBravenboer - 30 Oct 2003

Tools.XmlSyntaxDefinition moved from Stratego.XmlSyntaxDefinition on 27 Jun 2004 - 19:56 by MartinBravenboer - put it back