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

Re: XML source with DOCTYPE declaration

Subject: Re: XML source with DOCTYPE declaration
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 20 Apr 2001 14:47:55 +0100
source xhtml basic
Hi Zeljko,

> But then I do not understand why it is necessary to add the
> namespace to every (X)HTML element/tag as it is being done?

It might be there to 'help' because it means you could include the DTD
and use one of the subelements (like just a 'div' or something), and
it will automatically declare the namespace for that element (and its
descendants).

> To be precise I am using the DTD from XHTML Basic 1.0. It's DOCTYPE
> declaration looks like this:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
> "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">

Oh, it's probably that the DTDs that I have aren't the ones from the
XHTML modularisation initiative.

> Well, when I place a <xsl:cop-of/> at the template matching the root
> element ("/"), I receive the following output:
[snip]
> I'm using Xalan J 2.0.0 as XSLT processor.
> Any hints how to deactive this??

Yes - get Xalan J 2.0.1.  Looking at the release notes, it's a bug
that Xalan J 2.0.0 used to access the comments in the DTD in that way,
that's been fixed now.

> Is there a possibilty to check in the XSLT stylesheet which or how
> many namespaces are declare/used in the XML file which is being
> transformed?

Yup. You can access namespace nodes for a particular element to tell
you what namespaces are 'in scope' (have been declared) for that
element. The name of these namespace nodes gives the prefix that's
been used in the source XML; the *value* of the namespace nodes gives
the namespace URI that they've been declared with. So for example, if
you do:

  <xsl:for-each select="/*/namespace::*">
     Prefix: <xsl:value-of select="name()" />
     URI: <xsl:value-of select="." />
  </xsl:for-each>

Then you should be able to see what namespaces have been declared.
  
I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.