[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
Re: Find the root element from an attribute node
Subject: Re: Find the root element from an attribute node|
From: "Vladimir Nesterovsky" <vladimir@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jul 2008 18:39:11 +0300
You may use
OK. So none of these work - and why not? Do I really have to assign a
namespace? Remember, I'm processing documents from different namespaces so
I'd rather not.
Here is an example of the document followed by the xsl that doesn't work.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html SYSTEM
Boo to a goose
Is there a way to say "any namespace"? Why isn't that the default?
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: 10 July 2008 15:00
Subject: RE: Find the root element from an attribute node
I want to detect
whether the ancestor of the particular href is <html> as opposed to
<map>, <task>, <concept> or <reference> so that I can treat it
differently. How do I do it?
Is never going to work.
Why not? match="html//@href" is more conventional, but your form is just
good. It assumes, of course, that you somewhere do apply-templates to the
I've read with bewilderment the
threads about the xslt spec and that attributes are children of
elements but elements are not parents of children...
No you've got that the wrong way around.
The relationship between elements and subelements is called "child" in one
direction and "parent" in the other.
The relationship between elements and attributes is called "attribute" in
one direction and "parent" in the other.
You can always go up from an attribute using the parent or ancestor axes.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format