[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
Re: Namespaces best practice in XML
Subject: Re: Namespaces best practice in XML|
From: "tom tom" <tomxsllist@xxxxxxxxxxx>
Date: Tue, 04 Apr 2006 16:17:05 +0100
path-default-namespace is exactly what I am looking for, I didn't know this
One further question:
If I (using saxon8) apply the following XSLT:
<xsl:stylesheet version="2.0" xmlns="http://www.eeeeee.com"
<xsl:template match="ppp" priority="2">lllllllllllllllllll</xsl:template>
to the following XML
The match="ppp" does not get invoked yet I have declared the default
namespace to be the same namespace as <ppp> is in in the XML. Why does this
From: David Carlisle <davidc@xxxxxxxxx>
Subject: Re: Namespaces best practice in XML
Date: Tue, 4 Apr 2006 15:28:57 +0100
> at I need this stylesheet to be
> as accessible to as many people as possible. Having to prefix all source
> elements in the XSLT when that prefix doesn't physically exist in the
> adds a level of complexity that non-namespace-savvy developers might
I think people get used to this pretty quickly (if they look at xsl for
very long at all) if in the stylesheet you declare a prefix a: and then
select a:foo that means select foo in that namespace, whatever prefix
(including no prefix at all) is used in the source file. the source file
doesn't have to use the same prefix a:. This is just a general rule: there
is really nothing special about the so called default namespace here.
Although having said that, a lot of people did apparent;y want to use
non-prefixed element names to refer to namespaced elements in XPath so
in XPath2 (and so in XSLT2) you will be able to set the default Xpath
element namespace, and have everything that you want.
> use a version of HTML which doesn't require a namespace declaration
which of course is _all_ versions of html. Namespaces don't apply to
HTML, only to XHTML (all versions of which do require the elements to be
in a namespace, sadly different namespaces for XHTML 1 and XHTML 2)
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Are you using the latest version of MSN Messenger? Download MSN Messenger
7.5 today! http://join.msn.com/messenger/overview
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