Re: [xsl] Selecting a descendant child at arbitrary depth

Subject: Re: [xsl] Selecting a descendant child at arbitrary depth
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 14 Mar 2001 11:35:50 GMT
>  does not specify any namespaces or even DTDs to validate against:
You don't validate against namespaces, they are just sets of names.

>  So if this is true, how did it know that <html xmlns="...">
> was changing the namespace? 

Because xmlns="..." is a namesapace declaration.
XSLT (only) supports files that conform to the Namespaces in XML
Recommendation. That's also how it knows that the XSL file is indeed
XSL, by recognising
xmlns:whatever="http://www.w3.org/1999/XSL/Transform";


> Is the "xmlns" attribute a "protected keyword" attribute?  I

yes, or rather, according to the Xpath data model it's not an attribute
at all, it's a namespace declaration.

> Is there any other attribute names that I can't use?
The XML specification restricts all names beginning with xml (any case).

> "How do I get the stylesheet to work with
Declare the XHTML namespace in your stylesheet
xmlns:h="http://www.w3.org/TR/xhtml1";

(say on the xsl:stylesheet element)

then match against h:html not html in your Xpath expressions.

Note that your source document whilst conforming to the Namespace Rec
misuses namespaces as it claims that docBody is an element in the XHTML
namespace.

It would be better if you had

<html xmlns="http://www.w3.org/TR/xhtml1";>
**XHTML tags**
<my:docBody xmlns:my="mailto:pmcevoy@xxxxxxxx";>

so that it was clear who was defining which elements.

> Is there a way to get the stylesheet to ignore these xmlns declarations?
no.
You can have match="html|h:html" if you want to match against either
form.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread