I have a software which creates XML-Files with a structure looking like this:
<model>
<dims>
<dim type="attr" name="foo">
<def>Insert Definition of the Dimension 'foo'</def>
<hiers>
<hier name="foo">
<def>Insert Definition of the Hierarchy 'foo'</def>
<lvlrol lname="bar"/>
</hier>
</hiers>
<lvls>
<lvl tag="bar" name="bar">
<def>Insert Definition of the Level 'bar'</def>
</lvl>
</lvls>
</dim>
<dim type="attr" name="baz">
<def>Definition of baz</def>
[...]
</dim>
</dims>
</model>
Now I want to import the definitions (<def>
) from every <dim>
and every <hier>
in Lyx, or at least in Latex.
The Lyx-Document should have a (sub-)chapter for every <dim>
in which all corresponding <hier>
s are explained. These chapters shall solely be created from the definitions of the XML-File.
How do I do that? I know how to put a whole XML-File into Latex ( Including XML file into LaTeX ) but I just want to import all definitions in a row.
Best Answer
With your
xsl
file you're translating from xml to html. But you can also translate to plain ascii text, or to latex using the using the<xsl:text>
tag. Here's the correspondingxsl
file:You can process it on the command line, e.g., with
xsltproc
:xsltproc -o output.tex template.xsl input.xml
Lyx I never really used. Does it support custom plugins or something like that?