[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Preserving CDATA sections?

Subject: Re: Preserving CDATA sections?
From: Dan Vint <dvint@xxxxxxxxx>
Date: Fri, 14 Dec 2012 17:54:39 -0800
Re:  Preserving CDATA sections?
Interesting idea using a custom element. I should have mentioned that my intention is to remove this CDATA content as part of the review and cleanup step at the end. The conversion team will be going through all the data modules to make sure nothing was lost in the conversion as well as enhancing some information that needs a human touch to create. I was trying to preserve the original markup incase there was a problem and it needed to be replaced. It would just be a cut and paste in the one file rather than having to go back to the source files.

I was really surprised when the <xsl:comment> approach didn't work. I didn't expect the markup to be stripped by that process. That was my first attempt that helped to find the changes in the original source. This was ok until I found a need to preserve the content in case I stripped too much while removing the change markup. The result of that also hide the issue of comments inside comments as they were stripped in this first attempt as well.

I'll give these ideas a try on Monday. Thanks

..dan

At 05:31 PM 12/14/2012, you wrote:

Anyone have ideas for an alternate solution?

Run your pipeline putting the old content you want to preserve into a custom element in a custom namespace. Your new content then has both the old content and the new content for you to visually do your comparison at the end of your pipeline to see what has changed.


At those points in your pipeline where you need to use an S1000D document model to validate an intermediate file, preprocess that file to strip out your custom element so that it doesn't trigger any problems.

And that stripping stylesheet will be handy when you are all done in order to remove the old content from the new file so that you only have the new file.

And the stripping stylesheet is small: only two template rules. One template rule catches all elements in your custom namespace and does nothing with them. The other template rule is the idiomatic identity template. Easy to write. Easy to use. Any time you need an intermediate file to produce a final output of some kind, just pre-process it and use your existing processes.

This is a scheme that doesn't use disable-output-escaping= and will work whether you serialize your intermediate files to output entities or pass intermediate trees from process to process. You don't have to worry about writing your own XML serialization logic (in XSLT of all languages!) and it will work regardless of what imaginative markup comes from your authors.

I hope this helps.

. . . . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--------------------------------------------------------------------------- Danny Vint

Panoramic Photography
http://www.dvint.com

voice: 619-938-3610

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.