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

Re: Namespaces best practice in XML

Subject: Re: Namespaces best practice in XML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 4 Apr 2006 15:28:57 +0100
selecting namespaced element with xpath
> at I need this stylesheet to be 
> as accessible to as many people as possible. Having to prefix all source XML 
> elements in the XSLT when that prefix doesn't physically exist in the XML 
> adds a level of complexity that non-namespace-savvy developers might find 
> confusing.

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)


David

________________________________________________________________________
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:
http://www.star.net.uk
________________________________________________________________________

Current Thread

Back To School Sale!

Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop.

Offer ends August 31, 2008.

Coupon Code
TRTY-C4JV-OFF

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-2007 All Rights Reserved.