March 1st, 2013, 05:06 PM
Keeping whitespaces in the XML
I am trying to keep the whitespaces and I thought xml:space="preserve" does it but it doesn't!
What should I do to see these whitespaces in xml?
<?xml version="1.0" encoding="UTF-8"?>
<things> Lots of whitespace
and new linee</things>
March 1st, 2013, 05:30 PM
Understanding xml:space. It preserves whitespace-only nodes, not all whitespace in general. (And only if the reader supports the attribute.)
How are you rendering the data?
March 2nd, 2013, 03:09 AM
Firefox. The source looks ok.
Originally Posted by requinix
March 2nd, 2013, 03:37 AM
The source has all the whitespace?
Then this is the normal "HTML collapses all whitespace to a single space" problem. You can use CSS, a <pre>, or &#38;nbsp; entities.
March 2nd, 2013, 04:44 AM
Thanks. While I got you here, instead of making more threads I ask a questions about namespace URI identifire.
Is this true or false:
The URI does not neccessarily exist! It is only a string that may not even exist.
In the example below, hs could be equal to anything.