xsl-list
[Top] [All Lists]

RE: [xsl] extracting HTML elements from document created by saxon:parse

2006-09-19 08:06:53
(a) to get <br/> rather than <br> in the output, don't use the HTML output
method.

(b) whereas your embedded document has the < characters correctly escaped as
&_lt;, it appears to contain & unescaped - that is, it contains &_#160;
where it should contain &_amp;#160; (Underscores added to prevent mailer
corruption). 

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Dharshana S Van Der Bona [mailto:dharshanav(_at_)yahoo(_dot_)com] 
Sent: 19 September 2006 15:26
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] extracting HTML elements from document created 
by saxon:parse

Hi All,

I'm suing the following template to extract all the html tags 
 that is not <a> in to the xsl output.

 <xsl:variable name="htmlContent" 
select="saxon:parse(concat('&lt;!DOCTYPE tag [&lt;!ENTITY 
nbsp 
''&#160;''&gt;]&gt;',concat(concat('&lt;tag&gt;',text()),'&lt;
/tag&gt;')))"/>
  <xsl:apply-templates select="$htmlContent"  />


    <xsl:template match="tag/*[name() != 'a']" >
        <xsl:element name="{name()}">
        <xsl:copy-of select="@*|text()|node()"/>
        </xsl:element>
    </xsl:template>

But it is not properly extracting tags such as <br/> and only 
outputs <br> Is there a way to fix this?

Also is there a way to get around the parser complaints of 
&nbsp; not declared exception?


Thanks,
Dharshana






--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>