Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CDATA and entity coded chars
I notice that GS uses entity coding for any special chars like "<>&" in the CDATA sections of the XML files.

I'm certainly no XML guru, but my understanding of CDATA is that you don't need to do that, in that the point of having a CDATA section is that the XML parser parses it as is without any conversions? Is there a particular reason that GS does it this way? Perhaps for a subsequent parser further down the processing stream?

The reason I ask is because I will be hand-editing the XML files and would much prefer not to have to use entity coding if I don't really need to.

Many thanks,
Just to follow up for future reference:

I've been hand-editing some pages' xml files and I didn't entity encode the &, <, >, " or ' chars. It didn't seem to break anything.

If I was to hazard a guess, I would say the html editor automatically entity encodes everything, for example it entity encodes a " to &quot; , which is why the CDATA sections get encoded. There's no harm in it. It makes it a bit harder to read in an editor like vim, but it seems you can use normal tags like <p> and it seems to work ok.

Users browsing this thread: 1 Guest(s)