Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2008, 09:50 AM
Authorized User
 
Join Date: Jun 2008
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Don't escape the whole thing with CDATA.

Hi,

We need to translate the content of our SOAP body (<sampledata>) to XML. By using CDATA on sampledata, the content is translated fine. However, there are times that we need to preserve some literals in the <payload>.

In the sample below, we need to keep this &gt;&gt; test only &lt;&lt; intact and not transform it into ">> test only <<"

<sampledata>&lt;message&gt;
  &lt;payload&gt;
&gt;&gt; test only &lt;&lt;
  &lt;/payload&gt;
&lt;message&gt;</sampledata>

Is it possible? (99.99% of me says that it isn't possible). Is there a workaround?

Thanks so much!





 
Old December 4th, 2008, 09:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

So basically you are double encoding it?

This would make the inside of the payload element the following:

&amp;gt;&amp;gt; test only &amp;lt;&amp;lt;

/- Sam Judson : Wrox Technical Editor -/
 
Old December 4th, 2008, 09:22 PM
Authorized User
 
Join Date: Jun 2008
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sam,

If the SOAP sender properly escaped the payload content the same way you did it we can preserve the literal when we CDATA <sampledata>?

Thanks for the clarification






Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript in CDATA doesnt escape html eruditionist XSLT 5 September 17th, 2008 01:07 PM
Add a CDATA section; add nodeset to CDATA section kssudhish XSLT 3 January 3rd, 2008 07:13 AM
About CSS Chapter 5 the <thing> + <thing> {} part thenetduck BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 February 7th, 2007 03:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.