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

RE: namespace cleanup for XHTML documents

Subject: RE: namespace cleanup for XHTML documents
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 13 Sep 2006 15:27:16 +0100
xhtml example xht
If you output an element without specifying a prefix, for example

<html xmlns="http://www.w3.org/1999/xhtml">

or

<xsl:element name="html" namespace="http://www.w3.org/1999/xhtml">

then the system will usually output the name without a prefix.

However, the other namespace xmlns="http://example.com/" may get in the way.
Can't tell you what to change without seeing your code.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: Wolfgang Jeltsch [mailto:wolfgang@xxxxxxxxxxx] 
> Sent: 13 September 2006 15:21
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  namespace cleanup for XHTML documents
> 
> Hello,
> 
> I have a stylesheet which outputs XHTML documents that look like this:
> 
> 	<?xml version="1.0"?>
> 	<xhtml:html
> 		xmlns="http://example.com/"
> 		xmlns:xhtml="http://www.w3.org/1999/xhtml">
> 	  <xhtml:head>
> 	    <xhtml:title>Hello</xhtml:title>
> 	  </xhtml:head>
> 	  <xhtml:body>
> 	    <ul xmlns="http://www.w3.org/1999/xhtml">
> 	      <li>1</li>
> 	      <li>2</li>
> 	    </ul>
> 	  </xhtml:body>
> 	</xhtml:html>
> 
> However, I want those documents to look like this:
> 
> 	<?xml version="1.0"?>
> 	<html xmlns="http://www.w3.org/1999/xhtml">
> 	  <head>
> 	    <title>Hello</title>
> 	  </head>
> 	  <body>
> 	    <ul>
> 	      <li>1</li>
> 	      <li>2</li>
> 	    </ul>
> 	  </body>
> 	</html>
> 
> That is, I want all namespace prefixes and unneeded namespace 
> declarations removed and a single default namespace 
> declaration at the top level.
> 
> How can I achieve this?
> 
> Best wishes,
> Wolfgang

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.