![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Pick/Choose XML from XSL [Thread Next] Re: Pick/Choose XML from XSLTo: NULL Date: 12/2/2004 4:53:00 AM On 1 Dec 2004 14:03:14 -0800, Prab_kar@h... (Prabh) wrote:
...
> Also, I want to ignore messages with 'debug' priority and
>print only the 'info' priority messages.
>
>
>Test.xml:
>==========================X M L==================================
...
> <task>
> <message priority="debug"><![CDATA[Info about Target Two: Ideally I
>shouldnt be displayed!!]]></message>
> </task>
...
> <!-- show the messages -->
> <xsl:apply-templates select="task"/>
...
>I'm unable to ignore/discard the 'debug' messages.
> I'm trying to use '<xsl:template
>match="message[@priority] != 'debug'
You could use a few different approaches:
<xsl:apply-templates select="task[message/@priority != 'debug']"/>
to apply templates only to those tasks with the right priority,
if <message> is the only possible child element of <task>, or
or
<xsl:template match="task">
<xsl:if test="message/@priority != 'debug'">
<xsl:value-of select="message"/>
</xsl:if>
<!-- ... other processing for contents of task ... -->
</xsl:template>
or even
<xsl:template match="message">
<xsl:if test="@priority != 'debug'><xsl:value-of select="."/></xsl:if>
</xsl:template>
--
Morris M. Keesan -- keesan@a...
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
