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

Namespace name of source document

Subject: Namespace name of source document
From: "Peter Stark" <stark@xxxxxxxxxxxxxx>
Date: Thu, 15 Jul 1999 12:43:13 -0700
xhtml1 xmlns
I am translating XHTML documents into other XHTML documents. The default
namespace is "http://www.w3.org/TR/xhtml1" in both the source document and
the stylesheet.

First, I have the following XHTML source document..

<html xmlns="http://www.w3.org/TR/xhtml1">
	<head>
		<title>Hello</title>
	</head>
</html>

..and use the following XTLS stylesheet...

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
                xmlns="http://www.w3.org/TR/xhtml1"
                indent-result="yes" >
<xsl:template match="html" >
<html>
<head>
	<title>
		<xsl:value-of select="head/title" />
	</title>
</head>
</html>
</xsl:template>
</xsl:stylesheet>

..the resulting document will surprisingly be..

		Hello

Why? Where are my html elements? Why does not "html" match "html" ?

If I instead use the following stylesheet..

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
                xmlns="http://www.w3.org/TR/xhtml1"
		    xmlns:h="http://www.w3.org/TR/xhtml1"
                indent-result="yes" >
<xsl:template match="h:html" >
<html>
<head>
	<title>
		<xsl:value-of select="h:head/h:title" />
	</title>
</head>
</html>
</xsl:template>
</xsl:stylesheet>

..the resulting document will be the expected...

<html xmlns:h="http://www.w3.org/TR/xhtml1"
xmlns="http://www.w3.org/TR/xhtml1">
<head>
<title>Hello</title>
</head>
</html>

Now it works. But I don't need the "h" namespace.

What is going on? Why must I use the "h" namespace to get this right?

I am using XT and have not tried any other translators.

Peter Stark

Phone.com
+1(650)817-1618


 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.