xml attribute not well-formed? -


simple question. if attempt at

<?xml version='1.0'?> <test key="blah('foo=1&bar=2')"> </test> 

in firefox, complains

xml parsing error: not well-formed location: file:///c:/tmp/dump2.xml line number 2, column 27:  <test key="blah('foo=1&bar=2')"> --------------------------^ 

why this? need escape?

<?xml version='1.0'?> <test key="blah('foo=1&bar=2')"> </test> 

is not well-formed xml. use:

<?xml version='1.0'?> <test key="blah('foo=1&amp;bar=2')"> </test> 

edit:

error message in oxygen xml editor:

f [xerces] reference entity "bar" must end ';' delimiter.

that means &bar parsed entity reference, here syntax error, is, missing ;. need escape & character using predefined entity (one of five) &amp;.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -