Subject: Re: [xsl] mystery #3: rendering embedded HTML From: Robert Koberg <rob@xxxxxxxxxx> Date: Sat, 13 Apr 2002 14:38:13 -0700 |
best, -Rob
"J" == Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> writes:
J> ... If you think that disable-output-escaping only works if J> your HTML has been escaped with CDATA sections, you're J> mistaken.
What I found was the other way around. When disable-output-escaping is _off_ and I try "<br>", I get "<br>" ... but the reverse is not true.
J> When you have an XML document like:
J> <envelope><p>My mal-formed HTML J> escaped.<br></envelope>
J> The XSLT processor views this as a tree like this:
J> envelope +- text: "<p>My mal-formed HTML escaped.<br>"
Hmmm ... this is not what I see with either xalan or xt. I get the entities spelled out in full, exactly as entered.
J> If this isn't working for you, please post a sample of your XML J> and the relevant part of your XSLT stylesheet and we'll see J> what we can do.
Sure thing, and thanks for looking at this; it's been driving me nuts for a long time. Here's a bit of sample data:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sports-content SYSTEM "dtds/sportsml-core.dtd"> <?cocoon-format type="text/xml"?> <sports-content id="icehockey/NHL/82900/preview"> <sports-metadata date-time=" April 12, 2002, at 10:52 AM ET " language="en-US" fixture-key="event-preview" fixture-source="iptc.org" fixture-name="Event Preview"> <sports-title>Recap: Phoenix vs. Minnesota</sports-title> </sports-metadata> <sports-event> <event-metadata event-key="82900" site-key="" site-name="" site-source="iptc.org" event-status="pre-event" /> <highlight class="snbody">
(Sports Network) - The Phoenix Coyotes hope to wrap up a playoff spot tonight
<P> when they welcome the Minnesota Wild to America West Arena.
<P> With 91 points, the Coyotes are eighth in the Western Conference -- one ahead of the Edmonton Oilers and one behind the Vancouver Canucks. Should they top the Wild this evening and the Oilers fall in regulation to Calgary, the Coyotes would end their one-year playoff drought.
</highlight> </sports-event> </sports-content>
================================================================ and the simplest possible XSL
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:template match="/">
<h3><xsl:value-of select="sports-content/sports-metadata/sports-title"/></h3>
<xsl:value-of select="sports-content/sports-event/highlight"/>
</xsl:template> </xsl:stylesheet>
================================================================ it does not matter if doe is set on or off in the value-of, the output result is identical, the browser sees a single block of text with literal "<P>" strings in it instead of paragraph breaks.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] mystery #3: rendering emb, Gary Lawrence Murphy | Thread | [xsl] Re: legacy embedded HTML, Gary Lawrence Murphy |
Re: [xsl] mystery #3: rendering emb, Gary Lawrence Murphy | Date | Re: [xsl] XSLT faq back on line, Sean Kelly |
Month |