Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Namespaces best practice in XML

From: David Carlisle <davidc@--------->
To:
Date: 4/4/2006 2:39:00 PM
> 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
________________________________________________________________________


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent