Skip to content

How do I typeset from an XML data file? #1461

Answered by Omikhleia
ctrlcctrlv asked this question in Q&A
Discussion options

You must be logged in to vote

No you do not have to convert XML to SIL-language.

SILE comes with XML parsing natively, though of course the elements need to be supported by appropriate commands. E.g. if you have a <sometag>blah</sometag> in your XML, you need a sometag command/environment to be provided and implement something.

The way I've done it is:

  1. Creating a package with a command for each XML element
    • Some of them being ignored or passthru with the xmltricks package, so I only have to focus on important elements.
    • In some cases I had to make my own extended version of a passthru, e.g. to ignore spaces etc. in structural elements.
    • Regular commands for each elements that needs to do something
  2. Creating a SIL "pre…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ctrlcctrlv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants