Hi,
I have input xml file say *input.xml*
<?xml version="1.0" encoding="UTF-8"?>
<document>
<div class='question'>
<div>
Solve by factoring:
<br/><br/>
*<am>
<math title="3/12"><mstyle displaystyle="true" fontfamily="serif"><mfrac> 3</mn><mn>12</mn></mfrac></mstyle></math>
</am>*
<br/><br/>
Give <i>either</i> of the two solutions.
</div>
</div>
</document> Then I have the tex file to generate the pdf say *generate.tex*
\usemodule[mathml]
\setupbodyfont[palatino]
\startxmlsetups xml:testsetups
\xmlsetsetup{test} {document|b|p|i|br|am} {xml:*}
\xmlsetsetup{test} {p[@class='tips']} {xml:tips}
\xmlsetsetup{test} {br[tag(1)='br']} {xml:brbr}
\xmlsetsetup{test} {div} {xml:div}
\xmlsetsetup{test} {input} {xml:input}
\xmlsetsetup{test} {input[@type='text']} {xml:inputtext}
\xmlsetsetup{test} {script|span} {xml:skip}
\xmlsetsetup{test} {div[@class='question']} {xml:question}
\xmlsetsetup{test} {div[@class='review']} {xml:review}
\stopxmlsetups
\xmlregistersetup{xml:testsetups}
\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:skip
\removeunwantedspaces\ignorespaces
\stopxmlsetups
\startxmlsetups xml:input
\stopxmlsetups
\startxmlsetups xml:inputtext
\blank
% \dontleavehmode\strut\blackrule[height=1pt,depth=0pt,width=\textwidth]
\dontleavehmode\underbar{\strut\char0\hskip\textwidth\strut}
\blank
\stopxmlsetups
\startxmlsetups xml:div
\blank
\xmlflush{#1}
\blank
\stopxmlsetups
\newcount\QuestionCounter
\startxmlsetups xml:question
\blank
\global\advance\QuestionCounter\plusone
\margintitle{\the\QuestionCounter}
\xmlflush{#1}
\blank
\stopxmlsetups
\startxmlsetups xml:review
% \blank
% \xmlflush{#1}
% \blank
\stopxmlsetups
*\startxmlsetups xml:am
\xmlprocessdata{}{
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<msup> <mi>x</mi><mn>2</mn> </msup>
<mo>+</mo>
<mrow>
<mn>4</mn><mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
</math>
}{}
\stopxmlsetups
*
\startxmlsetups xml:br
\par
\stopxmlsetups
\startxmlsetups xml:p
\par
\stopxmlsetups
\startxmlsetups xml:tips
\blank
\bgroup\bf Tips: \egroup\xmlflush{#1}
\blank
\stopxmlsetups
\startxmlsetups xml:brbr
\blank
\stopxmlsetups
\startxmlsetups xml:i
\bgroup\it\xmlflush{#1}\egroup
\stopxmlsetups
\startxmlsetups xml:b
\bgroup\it\xmlflush{#1}\egroup
\stopxmlsetups
\starttext
\xmlprocessfile{test}{whatever-011.xml}{}
\stoptext
\stop
now, I need your help to use *<am></am>* value from input.xml and use it in
*\startxmlsetups xml:am* *\xmlprocessdata*as parameter.
Thanks
Anand
On Tue, Dec 21, 2010 at 5:03 PM, luigi scarso On Tue, Dec 21, 2010 at 10:01 AM, Hans Hagen On 21-12-2010 8:04, Anand Raj wrote: Hi, how to map svg tags from xml and tex file.? Dump the svg blob in a file (say image-1.svg) and then use
\extenalfigure[image-1.svg] to place it. Conversion to pdf will happen
automatically then
if you have inkscape installed --
luigi ___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to
the Wiki! maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net ___________________________________________________________________________________