It's better with the attachment...
Renaud Aubin a écrit :
Hi Folks !
I'm currently writting a technical report in which I need to type some
XML an non-XML text.
Sample file (xml_test.tex):
I have some custom XML text (trivial) + a not-so-complicated xsl
transformation (a part is included within the test file). I know there
is verb-xml but... I need to improve it to support xpath expr. More
over, I want to preserve the initial indentation. The point is now, how
to improve verb-xml to support xpath expressions ? I'm working with Mark
II... Should I switch to Mark IV if I want to write a new XML verbatim
support (with lua)?
+ the bonus question: I want to add some support for the RelaxNG Compact
syntax, should I follow the procedure described on the wiki or switch to
Mark IV ?
The deadline for this technical report: end of october...
Regards,
Renaud
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
\setupcolors[state=start]
\starttext
\startXML
<xsl:for-each select="[EMAIL PROTECTED]'CIRC']">
<xsl:choose>
<xsl:when test="boolean(PROPERTIES/[EMAIL PROTECTED]'RATI'])">
<xsl:variable name="ratio" select="PROPERTIES/[EMAIL PROTECTED]'RATI']"/>
<ellipse>
<xsl:attribute name="rx">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'RADI']"/>
</xsl:attribute>
<xsl:attribute name="ry">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'RADI']*$ratio"/>
</xsl:attribute>
<xsl:attribute name="cx">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'POSN']/X"/>
</xsl:attribute>
<xsl:attribute name="cy">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'POSN']/Y"/>
</xsl:attribute>
<xsl:attribute name="stroke">
<xsl:text>black</xsl:text>
</xsl:attribute>
<xsl:attribute name="stroke-width">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'WIDT']"/>
</xsl:attribute>
<xsl:attribute name="fill">
<xsl:text>none</xsl:text>
</xsl:attribute>
</ellipse>
</xsl:when>
<xsl:otherwise>
<circle>
<xsl:attribute name="r">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'RADI']"/>
</xsl:attribute>
<xsl:attribute name="cx">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'POSN']/X"/>
</xsl:attribute>
<xsl:attribute name="cy">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'POSN']/Y"/>
</xsl:attribute>
<xsl:attribute name="stroke">
<xsl:text>black</xsl:text>
</xsl:attribute>
<xsl:attribute name="stroke-width">
<xsl:value-of select="PROPERTIES/[EMAIL PROTECTED]'WIDT']"/>
</xsl:attribute>
<xsl:attribute name="fill">
<xsl:text>none</xsl:text>
</xsl:attribute>
</circle>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
\stopXML
\input knuth
\stoptext
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________