Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Search in the value of an XML field >Thread Next - Re: Search in the value of an XML field Re: Search in the value of an XML fieldTo: NULL Date: 5/2/2006 11:07:00 PM
Bogdan Zamfir wrote:
> Thanks,
> I found that in help, and tryed to perform a case-insensitive search
>
> I want to find a node in a xml document using xpath
>
> The doc can contains the following text
> <optionname>Transmission: automatic</optionname>
> or
> <optionname>transmission: automatic</optionname>
> or something else, but transmission word is in the field anyway
>
> But I don't know the cases of transmission word
>
> So I want to perform a case-insensitive search, so I use a xpath
> expresion like this
>
> //optionname[contains(translate(., 'transmion',
> 'TRANSMION'),'TRANSMISSION')]
>
>
> But it doesn't works.
It works here (using Saxon 8).
test.xml:
<?xml version="1.0"?>
<options>
<optionname>Transmission: automatic</optionname>
<optionname>transmission: automatic</optionname>
</options>
test.xsl:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="options">
<xsl:value-of select="count(
optionname[contains(translate(.,'transmion','TRANSMION'),
'TRANSMISSION')])"/>
</xsl:template>
</xsl:stylesheet>
output:2
> Can anyone tell me what is wrong?
Your software is broken?
///Peter
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
