[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: namespaces and xmlns=""

Subject: Re: namespaces and xmlns=""
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Tue, 29 Nov 2005 13:17:44 +0200
xmlns image
Hi,

Because you have a default namespace different from no namespace and in this context you output an image element from no namespace. In order to have that the default namespace must be (re)set to no namespace.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


tom tom wrote:
Hi all, can someone explain why the following XML and XSLT produces an xmlns="" attribute on the image tag in the output. I am using MSXML4

XML:
<root/>

XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:local="#local-functions" xmlns:s="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" exclude-result-prefixes="msxsl local s dt rdf">


<xsl:variable name="rss_rdf_resource_image">
<xsl:element name="image">
<xsl:attribute name="rdf:resource">/images/logo042.gif</xsl:attribute>
</xsl:element>
</xsl:variable>
    <!--

-->
<xsl:template match="root">
<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:image="http://purl.org/rss/1.0/modules/image/">
<channel rdf:about="http://about.about.com/">
<title>Recently Edited Articles</title>
<link>http://about.about.com/dfgdsf</link>
<description>Recently Edited Articles</description>
<dc:date>2005-11-29T10:16+03:00</dc:date>
<xsl:copy-of select="$rss_rdf_resource_image"/>
</channel>
</rdf:RDF>
</xsl:template>
</xsl:stylesheet>


Output:

<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<channel rdf:about="http://about.about.com/">
<title>Recently Edited Articles</title>
<link>http://about.about.com/dfgdsf</link>
<description>Recently Edited Articles</description>
<dc:date>2005-11-29T10:16+03:00</dc:date>
<image rdf:resource="/images/logo042.gif" xmlns=""/>
</channel>
</rdf:RDF>


_________________________________________________________________
MSN Messenger 7.5 is now out. Download it for FREE here. http://messenger.msn.co.uk

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.