Input:
<?xml version="1.0" encoding="UTF-8"?>
<article>
<meta productid="CIJB" volumenum="22">
<journalcode>CIJB</journalcode>
<issn type="print">0269-2171</issn>
<issn type="electronic">1465-3486</issn>
</meta>
</article>
Desired Output:
<?xml version="1.0" encoding="UTF-8"?>
<article>
<meta productid="CIJB" volumenum="22">
<journalcode dummy="CIJB"/>
<issn type="print" dummy="0269-2171"/>
<issn type="electronic" dummy="1465-3486"/>
</meta>
</article>
everything is fine with all elements (issn etc see below) except the
<journalcode> element where I am tryin to suppress as well as test the
journalcode value (CIJB here).
Style sheet
<snip/>
<xsl:template match="article/meta/journalcode">
<xsl:element name="journalcode">
<xsl:attribute name="dummy">
<xsl:value-of select="string(.)"/>
</xsl:attribute>
<xsl:copy-of select="@*"/>
</xsl:element>
</xsl:template>
<xsl:template match="article/meta/issn[@type='print']">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="dummy">
<xsl:value-of select="string(.)"/>
</xsl:attribute>
</xsl:copy>
</xsl:template>
<xsl:template match="article/meta/issn[@type='electronic']">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="dummy">
<xsl:value-of select="string(.)"/>
</xsl:attribute>
</xsl:copy>
</xsl:template>
<snip/>.
Do let me know if I still required to give more details.
Thanks,
Pankaj
-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Monday, April 07, 2008 3:43 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Suppress and test
> wherein string "CIJB" can be anything (CIJB, CEDE or XXX
> etc). All I am trying to apply different modes depending upon
> <journalcode> string value and secondly trying suppress the
> string <journalcode dummy="whatever"/>.
>
> Hope it makes clear.
No it doesn't. But never mind, if you won't give the information I asked for
(sample input and output) then I will simply ignore the question.
Michael Kay
http://www.saxonica.com/
|