|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to translate XML with XHTML-formatted element
Maik,
Your inline "HTML" has been escaped, presumably to prevent it from being parsed (and with that effect in any case). If it's not parsed, it's not available to your XSLT processor to do anything with. All the processor sees are strings, and you can't match substrings with templates (nor is it clear what the point of that would be, as strings are simply sequences of characters, and have no node structure -- they're strings). In order to "un-escape it" (that is, parse it as if it were truly the markup it purports to represent), you have a couple of options: 1. Preprocess your input so that this text is not escaped, making it available as markup to parse. Where the input of such a process is <TITLE><b>Homer Simpson For President</b></TITLE> the output would be <TITLE><b>Homer Simpson For President</b></TITLE> This can be parsed and processed as normally. An XSLT engine connected to a serializer, with support for the disable-output-escaping feature, could be used to do this. Note that it can't fix broken pseudo-markup however, so YMMV. 2. Use an extension function to parse the text node and return the results as if it had been markup all along. For this, you need a processor that provides such a function, such as Saxon. It can't be done in standard XSLT. Good luck, Wendell At 02:12 PM 4/12/2005, you wrote: how can I translate XML files (like the following), which contain XHTML-formatted text in one element, to PDF using Apache FOP ? ====================================================================== 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 ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








