Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

HTML thru XML

Posted on 2003-10-23
14
Medium Priority
?
783 Views
Last Modified: 2013-11-19
I'm trying to send an HTML string through XML and I get this error:

msxml4.dll error 'c00ce502'

A string literal was expected, but no opening quote character was found.

If I take the node out that has that string, then the XML passes just fine.

Is it trying to interpret the string as HTML?
0
Comment
Question by:geoffsweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 4
  • +2
14 Comments
 
LVL 4

Expert Comment

by:farzinm
ID: 9607319
Can we see the node that has that string?
Maybe you are missing a quote in your HTML I am not sure though
0
 

Author Comment

by:geoffsweb
ID: 9607342
if I do a direct response.write and the string, the HTML displays just fine on the screen... it just errors out if I try and send back an xml payload

so you think it might be just missing a quote? the string is very long.
0
 

Expert Comment

by:spike7397
ID: 9610401
Apostrophes will get re-coded in xml format the minute you pass the string through xml.  The xml code for it is '.  If you want to decode it, on the other end, a simple way might be to create a xml document in some code behind, pass the encoded string into it, and retrieve it by the get inner text function.  In short, Xml has a slightly different decoding method than HTML.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9614485
First of all apostrophes are fine in XML; there is no need to encode them. (Tags are another matter). I suspect that your XML is not well formed.  But without seeing it, it is impossible to say.

Anthony
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 9616147
Well, there is another possibility...it could be an error from IE. If the contenttype is xml it will pass this error because the standard IE error page has some HTML which looks like this:

<font face="Arial" size=2>

which is bad XML...

Just a thought.
Brad
0
 

Author Comment

by:geoffsweb
ID: 9616166
I do get this error: <font face="Arial" size=2>

what does that mean?
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 9616189
Also, as an addition to what I just said: You may have an attribute value which doesn't start with a " or ', or in other words, there is an unquoted attribute. Now, this is valid HTML...but not valid in XML. Once you have discovered what the error message actually says, do a search for these characters: /=[ ]*[^"']/ and you should get the culprit.

Hope that helps.
Brad
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 9616206
It means there could be an IE error. Check to make sure that ALL of your attributes have double quotes. The error you got is NOT valid XML becasue the 'size' attribute is not double quoted.

Brad
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9616291
bdobyns,

>>Now, this is valid HTML...but not valid in XML<<
I know exactly what you are saying, but strictlty speaking you mean "but not well formed XML". (I mentioned this previously)  "Valid" implies there is a DTD or Schema involved, which is a different story.

Anthony
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 9616307
Yes, well, I guess there are different ways to say the same thing. :o)

Brad
0
 

Author Comment

by:geoffsweb
ID: 9616409
OK, I corrected the syntax and I got the XML to save back to the original page.  But now the XML is interpretting the HTML string I'm trying to pass as XML.  Here's the output:
(where vHTML should just be a string that contains HTML, but it seems to be interpretted as XML? the string should be this:
vHTML = "<tr><td>test</td></tr>"

<?xml version="1.0" ?>
- <SOAP:Envelope xmlns:SOAP="urn:schemas-xmlsoap-org:soap:vl" xmlns:m="my-name-space">
- <SOAP:Body>
- <user>
  <StateID>OH</StateID>
  <StateName>Ohio</StateName>
  <Name>CCH User 1</Name>
  <AdminRights>10</AdminRights>
  <Load>T</Load>
  <MSG />
- <vHTML>
- <tr>
  <td>test</td>
  </tr>
  </vHTML>
  </user>
  </SOAP:Body>
  </SOAP:Envelope>

make sense??
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9616483
>>Yes, well, I guess there are different ways to say the same thing. <<
Actually, that was my point they are not the same.  "Well-formed" is one thing "Valid" is something totally different.  In the context of the question I believe we are talking about well-formed not valid.

Anthony
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 9616513
>>make sense?? <<
I think so.  You will have to wrap the HTML in a CDATA segment as follows:
<?xml version="1.0" ?>
<SOAP:Envelope xmlns:SOAP="urn:schemas-xmlsoap-org:soap:vl" xmlns:m="my-name-space">
      <SOAP:Body>
            <user>
                  <StateID>OH</StateID>
                  <StateName>Ohio</StateName>
                  <Name>CCH User 1</Name>
                  <AdminRights>10</AdminRights>
                  <Load>T</Load>
                  <MSG />
                  <vHTML><![CDATA[<tr><td>test</td></tr>]]></vHTML>
            </user>
      </SOAP:Body>
</SOAP:Envelope>

Anthony
0
 

Author Comment

by:geoffsweb
ID: 9626711
Thanks to everybody for all the help !!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to count occurrences of each item in an array.

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question