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

Re: xhtml and different namespace

Subject: Re: xhtml and different namespace
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Wed, 11 Jun 2003 09:47:20 +0100
elements from different namespace
From: Björn Boxstart <Boxstart@xxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  xhtml and different namespace
Date: Wed, 11 Jun 2003 09:37:29 +0200

Hello,

Ik have a strange problem with a document that I want to process. The document conforms to the XHTML dtd. The only thing I want to do is remove the DTD declaration and add a new top element. Although I set the output method to be xml, the document always is being returned as xhtml with the xhtml namespace.

I want to transform this resulting document (see below) with another xsl-t stylesheet.

<?xml version="1.0" encoding="UTF-8"?>
<Iisg source="biografie"><biography>
<xhead>
<meta xmlns="http://www.w3.org/1999/xhtml" name="generator" content="HTML Tidy for Windows (vers 1st August 2002), see www.w3.org"/>
<meta xmlns="http://www.w3.org/1999/xhtml" http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<link href="styles/bwsa.css" type="text/css" rel="stylesheet"/>


    <title xmlns="http://www.w3.org/1999/xhtml">Piet Aalberse</title>
  </xhead>

  <body xmlns="http://www.w3.org/1999/xhtml" bgcolor="#ffffff">
	<table>
		... more data to go here ...
	</table>
  </body>
</Iisg>

My problem is that the elements that have the namespace declaration as an attribute seem to have a prefix and therefore are not processed by my templates.

Something like match='title' doesn't work on a template while match="*[local-name() = 'title']" does. When I want to display the prefix (e.g. by <xsl:value-of select="substring-before(name(),':')" this doesn't return anything at all.

It looks like when I make a template for the body element like:

<xsl:template match="*[local-name() = 'body']">
	<xsl:apply-templates select="table" />
</xsl:template>

This doesn't seem to work because it looks like the table is part of another namespace as the body element. Does anybody know what I'm doing wrong? I tried several processors and they all have sort of the same result, so I think that I'm the problem and not the processor ;-(

Thanks in advance!

Best regards,

bjorn
?
?

I believe you just need to declare the xhtml namespace witha prefix in your stylesheet, usually don in the xsl:stylesheet element e.g.:
xmlns:xhtml="http://www.w3.org/1999/xhtml"
then you can match with:
match="xhtml:body"


--

Joe

_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger



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.