[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XML Public Indentifier
- From: Mike Moran <firstname.lastname@example.org>
- To: Nicolas LEHUEN <email@example.com>
- Date: Wed, 05 Sep 2001 13:39:22 +0100
Nicolas LEHUEN wrote:
> Should we coalesce this thread with the one about URN for namespaces ? Isn't
> there a similarity between a DTD PUBLIC id and a namespace URN ?
Well, you can set the default namespace *within* the DTD, which may be
resolved from the PUBLIC id.
I just got caught with this using XPath in XSLT, when I was matching on
some html. It worked as long as the DOCTYPE was not defined. This is
because the the XHTML DTD (which was found via the SYSTEM url) defines a
default namespace, as if you'd done <html xmlns="http://foo..."> in the
source html document. XPath in XSLT without a namespace qualifier won't
match the default namespace, so you have to locate the DTD, do a search
for "xmlns" in it, define that namespace in your XSLT and then use the
namespace in your XPath.
I'm sure you all know this, but I just thought I'd provide it as another
possible example of the problems with default namespaces.