Subject: Re: [xsl] Preserving CDATA sections? From: Dan Vint <dvint@xxxxxxxxx> Date: Fri, 14 Dec 2012 17:54:39 -0800 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Preserving CDATA sections, G. Ken Holman | Thread | Re: [xsl] Preserving CDATA sections, Michael Kay |
Re: [xsl] Preserving CDATA sections, G. Ken Holman | Date | Re: [xsl] Preserving CDATA sections, Michael Kay |
Month |