Examples
Language | #lines | Stylesheet | Text | XML | DTD | R-RNG | XML Schema | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Toy Example | 7 | nice.xsg | nice.txt | <==> |
nice.xml | nice.dtd | nice.rng | nice.xsd | |||||||
Student | 17 | students.xsg | students.txt | <==> |
students.xml | students.dtd | students.rng | students.xsd | |||||||
XFlat | 22 | xflat.xsg | xflat.txt | <==> |
xflat.xml | xflat.dtd | xflat.rng | xflat.xsd | |||||||
Business Cards | 26 | bcard.xsg | bcard.txt | <==> |
bcard.xml | bcard.dtd | bcard.rng | bcard.xsd | |||||||
Wiki(pedia) | 75 | wiki.xsg | wiki.txt | <==> |
wiki.xml | wiki.dtd | wiki.rng | wiki.xsd | |||||||
RELAX NG | 119 | relax.xsg | relax.txt | <==> |
relax.xml | relax.dtd | relax.rng | relax.xsd | |||||||
BibTeXML | 669 | bibxml.xsg | bibxml.txt | <==> |
bibxml.xml | bibxml.dtd | bibxml.rng | bibxml.xsd | |||||||
Usage examples
-
Transformation from non-XML to XML %> java -jar xsugar-all.jar students.xsg students.txt <students> <student sid="19701234"> <name>John Doe</name> <email>john_doe@notmail.org</email> </student> <student sid="19785678"> <name>Jane Dow</name> <email>dow@bmail.org</email> </student> </students>
Transformation from XML to non-XML %> java -jar xsugar-all.jar -r students.xsg students.xml John Doe (john_doe@notmail.org) 19701234 Jane Dow (dow@bmail.org) 19785678
Validity analysis (with DTD) %> java -jar xsugar-all.jar -a students.xsg students.dtd XML output is guaranteed to be valid!
Validity analysis (with Restricted RELAX NG) %> java -jar xsugar-all.jar -a students.xsg students.rng XML output is guaranteed to be valid!
Reversibility analysis (see dk.brics.grammar) %> java -jar xsugar-all.jar -b students.xsg Transformation is guaranteed to be reversible!