Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Control chars in XML


Control chars in XML

Author
Message
honza.mf
honza.mf
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1775 Visits: 1323
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
Toreador
Toreador
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2425 Visits: 8064
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>
honza.mf
honza.mf
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1775 Visits: 1323
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
Toreador
Toreador
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2425 Visits: 8064
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.
TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10787 Visits: 12024
Nice question. Illustrates how silly some of XML is.

Tom

Andre Guerreiro
Andre Guerreiro
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1065 Visits: 1514
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/MCSE/MCSA
honza.mf
honza.mf
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1775 Visits: 1323
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
Andre Guerreiro
Andre Guerreiro
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1065 Visits: 1514
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/MCSE/MCSA
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search