Ask the Expert

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>

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: