[Home] [By Thread] [By Date] [Recent Entries]
Lisa,
You're running into trouble because when you call in your external document using the document() function, it is being parsed and made available as a source tree. Tags-n-text are gone. In order to represent the tags-n-text (the XML file considered as literal data not as XML), you have a choice: 1. Preprocess the file to escape the markup. This is as simple as converting all occurrences of & to & and all occurrences of < to < (since those two characters are the "open markup delimiters"). Wrap it in an innocuous wrapper element so it can still be called in using document(). 2. Call it in using document() and then using an XSLT "tag-writing" stylesheet (module) to write it out as markup again. (Find such a stylesheet by Evan Lenz at http://xmlportfolio.com/xml-to-string/.) This method is fairly quick-and-dirty and it's not perfect, as you won't get "tag fidelity" (that is, the pseudo-markup that gets written out won't look just like the markup that went in: attributes may come out in a different order, CDATA marked sections won't appear as such, etc.), but it's easy to implement and fits into an XSLT 1.0 framework without fussing. 3. Find or develop a way to call in the external file not as XML using document(), but as literal text. In other words, keep it away from the parser. Fortunately for all of us, XSLT 2.0 now gives us a ready-made way to do no. 3: the unparsed-text() function. If XSLT 2.0 is an option for you, I recommend it. (I expect to be using that function quite a bit myself.) Cheers, Wendell At 09:11 AM 4/21/2006, you wrote: I am writing an XSL:FO document that will create a pdf document. One chapter will contain an "example XML". ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|

Cart



