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

Re: Namespace prefixes

  • From: "Ernest G. Allen" <ernestgallen@e...>
  • To: Tom Bradford <bradford@d...>, ReemaD@r...
  • Date: Thu, 09 Aug 2001 01:53:23 -0700

xsl prefix
At 11:54 PM -0700 2001-08-08, Tom Bradford wrote:
>ReemaD@r... wrote:
>>      I have some doubts on using prefixes in Namespaces.From the following
>> mentioned site
>> http://www.rpbourret.com/xml/NamespacesFAQ.htm
>> 
>> I found out that prefixes are not significant. But it doesn't work out in
>> my application when i replace xsl prefix with any arbitrary name like abc.


Note "xsl":                      ^^^

It sounds as if your application is written in XSLT.  If so, at
least the way most XSLT applications are configured, the "xsl:"
prefix is important.  Most (all?) XSLT processors associate "xsl:"
with the XSLT namespace by default.  See section 2.1 of the XSLT
recommendation at (http://www.w3.org/TR/xslt#xslt-namespace) for
details, specifically:

    The XSLT namespace has the URI http://www.w3.org/1999/XSL/Transform.

and

    This specification uses a prefix of xsl: for referring to
    elements in the XSLT namespace. However, XSLT stylesheets are
    free to use any prefix, provided that there is a namespace
    declaration that binds the prefix to the URI of the XSLT
    namespace.

If you are going to use "abc:" (or anything else) instead of 
"xsl:" for the prefix for XSLT elements in an XSLT application, 
you'll need to start your stylesheet with 

    <abc:stylesheet version="1.0"
        xmlns:abc="http://www.w3.org/1999/XSL/Transform">

instead of

    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

However, unless you have a good reason to use something other than 
the "xsl:" prefix for the XSLT elements, you'll be better off if 
you stick with "xsl:" -- no reason to confuse anyone who might 
need to modify or maintain your applications or reuse portions 
of them. 


/s/ Ernest G. Allen



>> 
>> So i am confused whether xsl prefix has any significance or not. If anybody
>> has tried this then please help me out.
>
>Prefixes are insignificant as far as the tools that you use to process a
>document are concerned.  They don't care what the prefix is, only what
>the namespace URI is.  But, within the document itself, the prefix is a
>shorthand for associating the namespace URI with an element or
>attribute, so if you change the prefix that's associated with the
>namespace URI, you need to change it everywhere for that context.  So it
>doesn't matter what prefix you use, although it is common to use a
>well-known prefix for clarity.
>
>-- 
>Tom Bradford --- The dbXML Project --- http://www.dbxml.org/
>We store your XML data a hell of a lot better than /dev/null
>
>------------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To unsubscribe from this elist send a message with the single word
>"unsubscribe" in the body to: xml-dev-request@l...




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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.