This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XML source with DOCTYPE declaration


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]