|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: deep "copy-of" a source fragment
Dave, you rock the house, baby!
I had actually tried the namespace declaration before but I had gotten it wrong. The HTML Tidy program outputs an [unqualified?] xmlns attribute (declaration) in the <html> root element so the namespace is "html". When I declared this in my the <xsl:stylesheet> root element *as you suggested* then xalan knew what the hell I was refering to by html:body and then behaved as expected. The source document element looks like this... <html xmlns="http://www.w3.org/1999/xhtml"> My stylesheet looks like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml">
<xsl:template match="/">
<xsl:copy-of select="/html:html/html:body/node()"/>
</xsl:template>
</xsl:stylesheet>I was careful to get an exact match on the URI for the namespace declarations between the source document and the stylesheet. ** QUESTION(S): what is the deal with "where" you declare the namespace? Does it matter? Must I do all my declarations in the root element? If not, must I do all my declarations in the root stylesheet element if I want the XSL processor to match against them? ** My only concern is that if for whatever reason the namespace declaration changes, it will [silently] "break" my XSL templates. So maybe I will take the easy way out and suppress namespace declarations in my xhtml source reducing it to an anonymous well-formed document which is xhtml by convention (rather than validity). David Carlisle wrote: match="/html/body/" XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








