Subject: Re: xhtml DOCTYPE problem
From: Joerg.Heinicke@xxxxxx
Date: Thu, 17 Jan 2002 11:47:25 +0100 (MET)
|
Hello,
you have a namespace in your XML, so it it not only <html>, the
"http://www.w3.org/1999/xhtml" is important.
Either you have to add xmlns="http....." to your <xsl:stylesheet> or with a
name xmlns:xhtml="http....", but then you have to match on xhtml:html.
Regards,
Joerg
> I have a simple xhtml document:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE html SYSTEM "xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>my title</title>
> </head>
> <body>
> <p>para</p>
> </body>
> </html>
>
> Following template only outputs an emptye <test/>:
>
> <xsl:template match="/">
> <test>
> <xsl:value-of select="html/head/title"/>
> </test>
> </xsl:template>
>
> If I remove the DOCTYPE and the xmlns:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <html>
> <head>
> <title>my title</title>
> </head>
> <body>
> <p>para</p>
> </body>
> </html>
>
> I get what I expect: <test>my title</test>
>
> Can anybody explain this to me?
>
> Notes:
> -I tried this with both xalan and saxon
> -I had to change the DOCTYPE to SYSTEM and store the dtd locally,
> otherwise
> the xslt-processor cannot find it.
>
>
> Thanks
> _______________________________________________
> Houbrechts Ivo Siemens Atea n.v., IC D AS A
> Software engineer - Development Access Products
> Tel.: +32 14 25 22 69 Fax: +32 14 25 30 25
> E-mail: ivo.houbrechts@xxxxxxxxxxxxxxx
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|