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

RE: Find the root element from an attribute node

Subject: RE: Find the root element from an attribute node
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 11 Jul 2008 16:37:07 +0100
RE:  Find the root element from an attribute node
> OK. So none of these work - and why not? Do I really have to 
> assign a namespace? 

If your source document is in a namespace, then you must refer to its
elements by that namespace.

> 
> Is there a way to say "any namespace"? Why isn't that the default?
> 

The namespace is part of the name. Saying "any namespace" would be like
saying "anyone called Dave, don't care about the surname". That's fine so
long as your stylesheet never strays further than your own little closed
world, but if it's going to have wider exposure then you can't afford to be
so parochial.

Or to take another analogy, it's like publishing your phone number without
an international dialling code. By doing that, you are saying that you're
not expecting anyone outside your own country to want to talk to you.

What you can do in XSLT 2.0 is to say xpath-default-namespace="....". That
means that unprefixed names refer to a specific namespace, rather than to
names in no namespace.

Michael Kay
http://www.saxonica.com/

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.