Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: MSXML4 selectSingleNode NOT case sensitive

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent