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

RE: Namespace question

Subject: RE: Namespace question
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Wed, 7 Apr 2004 09:22:13 +0300
RE:  Namespace question
FAQ,

> I'm trying to transform an XHTML document whose root node looks like 
> this:
> 
> 	 <html xmlns="http://www.w3.org/1999/xhtml>
> 
> None of my templates match, and it's because of the default namespace 
> attribute.

No. It's because your node tests are not what you meant them to be. See <http://www.w3.org/TR/xpath.html#node-tests>:

  "A QName in the node test is expanded into an expanded-name using the namespace declarations from the expression context. This is the same way expansion is done for element type names in start and end-tags except that the default namespace declared with xmlns is not used: if the QName does not have a prefix, then the namespace URI is null--".

> What do I need to do to fix my stylesheet?

Add namespace declaration for the XHTML namespace with a prefix, e.g.

  xmlns:h="http://www.w3.org/1999/xhtml"

then write your patterns and expressions using it

  <xsl:template match="h:html">

Cheers,

Jarno

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.