473,396 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

salbatron cdata problem

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

<text>blah blah</text>

This gets changed to

<text>
<![CDATA[blah blah]]>
</text>

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

<text>
<![CDATA[
blah blah
]]>
</text>

If the merge transformation is run again then it will again assume the
line breaks outside the <![CDATA[ are part of it again so the code
will be

<text>
<![CDATA[

blah blah

]]>
</text>

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

Aug 29 '07 #1
2 1610
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 <xsl:strip-space elements="list-of-element-names"/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

Aug 29 '07 #2
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.
Aug 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Isaac Councill | last post by:
Hello, This seems like a newbie question, but I couldn't find the answer on google. I've been using xsl to transform rdf files into runnable programs in another (non-markup) language. It's...
0
by: Dimitre Novatchev | last post by:
You seem to be unaware of the xslt processing which uses the built-in rules in the absence of templates that match some selected node. http://www.w3.org/TR/xslt#built-in-rule According to the...
2
by: Dave Matthews | last post by:
Hi folks, I'm writing a web-page editing tool for my company which will allow staff (with no "technical" expertise) to maintain their own Intranet sites. The content for each webpage is stored...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString);...
1
by: soccerdad | last post by:
I've got a class hierarchy generated from a .xsd schema file using the XSD.EXE tool. One of the elements will have its "inner text" set to a CDATA block. The XSD.EXE tool exposed a "Value" property...
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
7
by: Max | last post by:
Hello everyone! Can anyone help me to convert the CDATA expression "CDATA ::= (Char* - (Char* ']]>' Char*)" to Javascript Regular Expression? Thanks, Max
18
by: sim.sim | last post by:
Hi all. i'm faced to trouble using minidom: #i have a string (xml) within CDATA section, and the section includes "\r\n": iInStr = '<?xml version="1.0"?>\n<Data><!]></Data>\n' #After i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.