salbatron cdata problem

salbatron cdata problem

am 29.08.2007 14:27:01 von andybdi

I am playing with a few xml feeds changing them into different formats
and merging them with others, and have found that when using cdata-
section-elements salbatron adds an extra line break at the begining
and end of the cdata tags. e.g.

Inital code is

blah blah

This gets changed to





Thats not the end of the world but when i then process this feed and
merge it with other stored feeds I use xsl:copy-of to simply copy that
node. cdata-section-elements is used again but this time it assumes
that the line breaks are part of the text and keeps them in so the
resulting code is


blah blah
]]>


If the merge transformation is run again then it will again assume the
line breaks outside the will be



blah blah

]]>


This keeps on occuring adding more and more line breaks into the
text. I can use normalize-space in the presentaiton of the text but
woudl prefer not to have to. it also means that I end up with files
that are very long and full of line breaks.

Does anyone have any ideas why this is happening and how to stop it.
Thanks for your help

Re: salbatron cdata problem

am 29.08.2007 14:47:07 von kork

andybdi wrote:
> I am playing with a few xml feeds changing them into different formats
> and merging them with others, and have found that when using cdata-
> section-elements salbatron
You probably mean Sablotron...

> adds an extra line break at the begining

You can use the to
define elements for which you want to have whitespace stripped. Maybe this
is helping with the situation..

Best regards,
Jan
--
____________________________________________________________ _____________
insOMnia - We never sleep...
http://www.insOMnia-hq.de

Re: salbatron cdata problem

am 29.08.2007 18:22:25 von andybdi

Sorry about the spelling, although salbatron does sound a bit cooler!

Anyway, thanks for your help, unfortunatly this didn't work but I have
managed to fix the problem now. The problem was that I was specifying
indent="yes" in the xsl:output tag. This was indenting the cdata
section within the tag. So the next time is was run it was assuming
it was a correct line break including it and then indenting it all
again. When I took indent="yes" out it worked properly, although now
the whole file is spread over one line! Thanks for you help.