xsl-list
[Top] [All Lists]

[xsl] Is there a way to utilise disable-output-escaping in apply-templates?

2006-09-14 05:46:00
Thanks for the reply mike. Upon testing, i noticed that
disable-output-escaping works on like   &#nbsp; while failing
with likes of ’ And I got more confused looking at the html
output and view source.

see ‘abnormality’ text. (or Am i wrongly undertood its
usage?)

So, I have stripped down my xml, xsl to see what i get in html (see
below). I use Saxon B. Pls ignore any spell mistake or extra xslt
code if present, as it was a scaled down version.

My xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
        <FrontMatter>
                <CourseCode>B700</CourseCode>
                <CourseTitle>Improving Performance</CourseTitle>
                <ItemID>Session 7</ItemID>
                <ItemTitle>Cross-functional perspective</ItemTitle>
                <Imprint>
                        <Standard>
                                <GeneralInfo>
                                        <Paragraph>This publication  'ab' 
&#x2018;abnormality&#x2019; -
&#160; - &amp;#nbsp; forms part of an =&#160;= &amp;#160;
space</Paragraph>
                                </GeneralInfo>
                        </Standard>
                </Imprint>
        </FrontMatter>
</Item>


XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:output method="html" indent="yes" name="html"/>
        <xsl:template match="/">
                <!-- Creating  -->
                <xsl:result-document href="unicode_output.html" format="html">
                        <html>
                                <body>
                                                <p>
                                                        Normal: <xsl:value-of 
select="//Paragraph[1]"/>
                                                </p>
                                                <p>
                                                        Esc Yes: <xsl:value-of 
select="//Paragraph[1]"
disable-output-escaping="no"/>
                                                </p>
                                                <p>
                                                        Esc No: <xsl:value-of 
select="//Paragraph[1]"
disable-output-escaping="yes"/>
                                                </p>
                                </body>
                        </html>
                </xsl:result-document>
        </xsl:template>
</xsl:stylesheet>


Html source:
<html>
   <body>      
<p>Normal: This publication  'ab' ?abnormality? - &nbsp; -
&amp;#nbsp; forms part of an =&nbsp;= &amp;#160; space
      </p>
<p>Esc Yes: This publication  'ab' ?abnormality? - &nbsp; -
&amp;#nbsp; forms part of an =&nbsp;= &amp;#160; space
      </p>      
<p>Esc No: This publication  'ab' ?abnormality? -   - &#nbsp; forms
part of an = = &#160; space
      </p>
   </body>
</html>


My q's are: 
1) I wish to know how to escape those 2019, 2018's etc without them
converting into single quotes ('s). In the sense, I am expecting to
get an output - &#x2018;abnormality&#x2019; as in XML and not
?abnormality?

2) On the browser, This publication  'ab' ?abnormality? is seen as
...publication 'ab' â??abnormalityâ?? 
Why ? is dipslayed as â???

Thanks in adv
karl


                
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--