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

RE: xmlns=""

Subject: RE: xmlns=""
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 11 Mar 2003 19:02:35 -0000
xsl xmlns
Your root template is carefully outputting the html, head, and body
elements in the XHTML namespace, and I suspect the other template rules
are outputting the other elements in the null namespace. So Saxon has to
output the namespace undeclaration xmlns="" to prevent them inheriting
the XHTML namespace.

It would be simplest to move the declaration of the XHTML namespace from
your root xsl:template to the xsl:stylesheet element.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Gustaf Liljegren
> Sent: 11 March 2003 16:44
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xmlns=""
> 
> 
> It seems I have still things to understand about namespaces. 
> I made a stylesheet to convert an in-house XML format to 
> XHTML 1.1. For some reason, I get a xmlns="" on each 
> top-level element beneath <body>. If I remove the default 
> namespace declaration in the <html> root element, they disappear. 
> 
> Here's an abbreviated excerpt of the output:
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> 
> <!DOCTYPE html
>   PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> >
> <html 
> xmlns="http://www.w3.org/1999/xhtml" xml:lang="sv">
>    <head>
>       <title>...</title>
>       <link rel="stylesheet" type="text/css" href="style.css"/>
>    </head>
>    <body>
>       <h1 xmlns="">...</h1>
>       <p xmlns="">...</p>
>       <h2 xmlns="">...</h2>
>       <p xmlns="">...</p>
>       <table xmlns="">
>          ...
>       </table>
>       <ul xmlns="">
>          <li>...</li>
>          <li>...</li>
>          <li>...</li>
>       </ul>
>    </body>
> </html>
> 
> And here's the template for the root element:
> 
>   <!-- Root node template -->
>   <xsl:template match="/">
>     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sv">
>       <head>
>         <title><xsl:value-of select="heading1"/></title>
>         <link rel="stylesheet" type="text/css" href="style.css"/>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
> 
> My XSLT processor is Saxon 6.5.2.
> 
> Gustaf
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


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.