xsl-list
[Top] [All Lists]

Re: Disable namespace declaration in output XML

2005-02-15 01:37:25
Thanks mukul.

regards,
Ranjan
--- Mukul Gandhi <mukul_gandhi(_at_)yahoo(_dot_)com> wrote:

Please use exclude-result-prefixes
<xsl:stylesheet version="1.0"
  xmlns:exslt="http://exslt.org/common";
  xmlns:java="http://xml.apache.org/xslt/java";
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  exclude-result-prefixes="exslt java" >

The XSLT 1 spec says..
When a stylesheet uses a namespace declaration only
for the purposes of addressing the source tree,
specifying the prefix in the exclude-result-prefixes
attribute will avoid superfluous namespace
declarations in the result tree.

The value of exclude-result-prefixes is a
whitespace-separated list of namespace prefixes.

Regards,
Mukul

--- "Ranjan K. Baisak" <ranjanbaisak(_at_)yahoo(_dot_)com>
wrote:

My stylesheet generates an XML document. But the
xml
contains namespace declarations, which I don't
want.
The header part of my stylesheet is:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:exslt="http://exslt.org/common";
    xmlns:java="http://xml.apache.org/xslt/java";
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:output method="xml" version="1.0"
encoding="UTF-8" 
    indent="yes"/>

The glimpse of xsl producing xml is:
<reportdetails>
    <xsl:attribute name="name"><xsl:text>Chart
List</xsl:text></xsl:attribute>
    <xsl:attribute name="generated"><xsl:value-of

select="java:java.util.Date.new()"/></xsl:attribute>
    <xsl:attribute name="user"><xsl:value-of
select="$username"/></xsl:attribute>
</reportdetails>

 and the output is:
<?xml version='1.0' encoding='UTF-8' ?>
<reportdetails
xmlns:java="http://xml.apache.org/xslt/java";
xmlns:exslt="http://exslt.org/common"; name="Chart
List" generated="Tue Feb 15 13:00:54 GMT+05:30
2005"
user=""/>

I don't want namespace declaration in the xml
file.
Any help would be appreciated.
regards,
Ranjan


            
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.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>
--~--





              
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search.
Learn more.
http://info.mail.yahoo.com/mail_250


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





                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

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