Q

Using XML DOM object to make a database call

On my Web page (IE5.0), I am using XML DOM object to make a database call. The result set is received in XML format by the client function (javascript) which parses it. If my XML text content contains the character '(r)' then on some user machine the parser errors with a message 'invalid character in the text content'. On most other systems, it handles it just fine. What is the problem and how can I fix it? Here is a sample of XML...

text:

<ResultSet>
         <Record>
                 <Name>
                         <![CDATA[Intel(r)
PRO-10-100-1000-Wireless]]>
                 <Name>
        </Record>
</ResultSet>

The problem here is not to do with the "(r)". There are two problems with your sample XML:

1. The CDATA section markup has been rendered incorrect by the replacement of "[" and "]" characters with references to characters 91 and 93. Using character references rather than characters themselves hides the CDATA section from the parser. I doubt that this is what you want to do.

2. There is a <Name> start-tag where the end-tag should be (before the Record end-tag.


This was first published in February 2002

Dig deeper on XML and XML schema

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close