Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - MSXML4 selectSingleNode NOT case sensitive >Thread Next - Re: MSXML4 selectSingleNode NOT case sensitive Re: MSXML4 selectSingleNode NOT case sensitiveTo: NULL Date: 2/3/2005 2:53:00 PM
Dam wrote:
> From a third party I get a xml string that is sometimes in upper case,
> sometimes in lower case.
> Example:
> sometimes: <xml><error_code>Not An Error</error_code></xml>
> sometimes: <xml><Error_code>Not An Error</Error_code></xml>
> sometimes: <xml><erRor_code>Not An Error</erRor_code></xml>
> etc. etc. etc.
>
> I load the xml into a xml-dom object (MSXML4), and now I want to do a
>
> objXML.selectSingleNode(\\error_code).Text
>
> But selectSingleNode is case sensitive, how can I make
> selectSingleNode case UNsensitive?
selectSingleNode("//*[translate(local-name(),
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') =
'error_code']")
> Is there a simple way to make all the nodes lower-case (without making
> the 'text' in the nodes lowercase too)?
It would be possible to write an XSLT stylesheet to do that.
> Is there a propertie that makes the xml object case UNsensitive?
No, I don't think so, you would better design a DTD or schema for the
XML and then make anyone involved validate against the DTD or schema as
that way you do not get those case problems.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
