Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT code >Thread Next - Re: XSLT code Re: XSLT codeTo: NULL Date: 6/6/2008 4:24:00 PM
paul_0403@y... wrote:
>> <xsl:template match="ResponseFile[not(node())]">
>> <xsl:copy>
>> <xsl:value-of select="$response_file"/>
>> </xsl:copy>
>> </xsl:template>
> Note the elments are a bit different since there is an attrtibute
> "Mode" in the ResponseFile element
> as there is no attribute in the StatusFile element.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <CentralServerRequest>
> <RequestInfo>
> <ResponseFile Mode="Overwrite"></ResponseFile>
If you want to copy the attribute use
<xsl:template match="ResponseFile[not(node())]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:value-of select="$response_file"/>
</xsl:copy>
</xsl:template>
> Based on that, I am assumming the XSLT code has to look a bit
> different when doing the match? Is there some sytnax to specify the
> atttibute name in the matc?. It would be okay with matching
> "ResponseFile Mode" and skipping the value "OverWrite" since my Mode
> can have several different
> values that I may want to ignore.
If you want to add the text if the Mode attribute exists then use
<xsl:template match="ResponseFile[@Mode and not(node())]">
<xsl:copy>
<xsl:value-of select="$response_file"/>
</xsl:copy>
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
