Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345

Control chars in XML Expand / Collapse
Author
Message
Posted Friday, May 21, 2010 5:17 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 1:20 AM
Points: 1,387, Visits: 1,315
Toreador (5/21/2010)

Not quite the same, but I've now done exactly the above and get the same error.
Note - the error appears in a popup window. I've a feeling that depending on your browser settings the error may show as an exclamation mark in the status bar instead, double-clicking shows the error.


If you are using Notepad as your text editor, try to use Save As and check file encoding. XMLs work fine with UTF-8. If you have xml declaration, encodings must fit.


Just because a browser might display it doesn't mean it's valid!
IE can cope with all sorts of invalid HTML as well, making (sometimes correct!) guesses about what is intended, but the HTML is still wrong.


It's playing with words. XML contains invalid characters. Browsers are allowed to display them.
It's in the grey zone; neither valid, nor strictly invalid.
You can't compare XML and HTML. XML is very strict, HTML is very relaxed by definition.




See, understand, learn, try, use efficient
© Dr.Plch
Post #925841
Posted Friday, May 21, 2010 5:22 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:05 AM
Points: 1,782, Visits: 6,479
honza.mf (5/21/2010)
If you are using Notepad as your text editor, try to use Save As and check file encoding. XMLs work fine with UTF-8. If you have xml declaration, encodings must fit.


Yes, it's UTF-8.
It's definitely related to the invalid characters - if I edit it and remove all the '&#' then it displays fine.

This gives the error:
<rows>
<_x0023_t a="�" />
</rows>

This does not:
<rows>
<_x0023_t a="x0;" />
</rows>
Post #925844
Posted Friday, May 21, 2010 5:35 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 1:20 AM
Points: 1,387, Visits: 1,315
Toreador (5/21/2010)

This gives the error:
<rows>
<_x0023_t a="�" />
</rows>

This does not:
<rows>
<_x0023_t a="x0;" />
</rows>

It can be some error during copy-paste. I had no problem. Where have you copied the XML segment from?

Bad thing in these forums is, HTML washes all XML/HTML details away, as you can see in the "source" of your post and the displayed result. And the devil is in details.




See, understand, learn, try, use efficient
© Dr.Plch
Post #925854
Posted Friday, May 21, 2010 5:39 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:05 AM
Points: 1,782, Visits: 6,479
honza.mf (5/21/2010)
It can be some error during copy-paste. I had no problem. Where have you copied the XML segment from?

Bad thing in these forums is, HTML washes all XML/HTML details away, as you can see in the "source" of your post and the displayed result. And the devil is in details.


Copied from the output of the SQL.
And the XML displayed in my post is exactly the same as what I pasted.
Post #925858
Posted Sunday, October 17, 2010 3:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:57 AM
Points: 7,801, Visits: 9,551
Nice question. Illustrates how silly some of XML is.

Tom
Post #1005924
Posted Saturday, September 3, 2011 3:52 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 1:04 PM
Points: 900, Visits: 1,490
Which IE version? One should be very careful to post an answer referring to a specific application without an explicit version. Sorry but not all machines will have the same results in these conditions.

Best regards,



Best regards,

Andre Guerreiro Neto

Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2
Post #1169662
Posted Sunday, September 4, 2011 2:40 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 22, 2014 1:20 AM
Points: 1,387, Visits: 1,315
codebyo (9/3/2011)
Which IE version? One should be very careful to post an answer referring to a specific application without an explicit version. Sorry but not all machines will have the same results in these conditions.

Best regards,



Two or three last versions.
Which one have you tried?




See, understand, learn, try, use efficient
© Dr.Plch
Post #1169784
Posted Sunday, September 4, 2011 4:34 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 1:04 PM
Points: 900, Visits: 1,490
honza.mf (9/4/2011)
codebyo (9/3/2011)
Which IE version? One should be very careful to post an answer referring to a specific application without an explicit version. Sorry but not all machines will have the same results in these conditions.

Best regards,



Two or three last versions.
Which one have you tried?


Well, I was using IE 7. An error is shown. The same as of those posts before mine. And I have edited the XML to contain <root>. Not sure what happened then. Maybe it's only me.

Best regards,



Best regards,

Andre Guerreiro Neto

Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2
Post #1169792
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse