Re: [xsl] namespace is part of HTML tag???

Subject: Re: [xsl] namespace is part of HTML tag???
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 02 Jun 2002 20:51:49 -0700
At 2002-06-03 09:53 +0800, Goh Hong Ling wrote:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:user="http://www.w3.org/1999/XSL/Transform";
                version="1.0">

I used the msxsl:script in my code to do certain XML to HTML transformation
thru XSL .  But the weird thing is that when I viewSource my HTML page, I
always found  <tr xmlns:msxsl="urn:schemas-microsoft-com:xslt">.

This is coming from element nodes in your stylesheet tree that have namespace nodes attached for the msxsl: namespace.


How can I eliminate the extra note in the <TR>???

By pruning from the stylesheet tree those namespace nodes you do not wish to see in your result tree.


Any idea how to solve this problem??

In your document element, add the following attribute:


exclude-result-prefixes="msxsl"

Wherever you use this attribute (or xsl:exclude-result-prefixes= when you use it on a literal result element instead of an instruction), that element node in the stylesheet tree and all descendent element nodes will not have the named namespace nodes attached, thus they will not be copied to the result tree.

I hope this helps.

................... Ken


-- Upcoming: 3-days XSLT/XPath and/or 2-days XSLFO:Sep 30-Oct 4,2002 - : 3-days XML Information Modeling: Jul 31-Aug 2,2002

G. Ken Holman                mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-07-1               Practical Formatting Using XSLFO
XSL/XML/DSSSL/SGML/OmniMark services, books(electronic, printed),
articles, training(instructor-live,Internet-live,web/CD,licensed)
Next public training:            2002-06-04,07,10,11,13,14,07-31,
-                                         08-05,26,27,09-30,10-03


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread