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

RE: Namespace prefixes

  • From: Dylan Walsh <Dylan.Walsh@K...>
  • To: ReemaD@r...
  • Date: Thu, 09 Aug 2001 11:25:13 +0100

xsl title
When you changed the prefix on your elements, did you also change the
prefix in the namespace declaration? If you have done that correctly,
then it should work, unless your XSLT processor is in violation of the
namespace and XSLT recommendations.

The prefix is used within a document to associate an element with a
declared namespace. Provided the prefix on the element matches the
specified prefix in the namespace declaration, the actual prefix is not
significant.

> -----Original Message-----
> From:	ReemaD@r... [SMTP:ReemaD@r...]
> Sent:	Thursday, August 09, 2001 7:10 AM
> To:	xml-dev@l...
> Subject:	Namespace prefixes
> 
> Hi All,
> 
>      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.
> 
> So i am confused whether xsl prefix has any significance or not. If
> anybody
> has tried this then please help me out.
> 
> Thanks in Advance,
> Reema Duggal
> 
> 
> 
> 11.3) Are prefixes significant?
> 
> 
> No.
> 
> 
> For example, the following are equivalent:
> 
>   <serv:Addresses
> xmlns:serv="http://www.tu-darmstadt.de/ito/addresses">
> 
> and
> 
>   <foo:Addresses xmlns:foo="http://www.tu-darmstadt.de/ito/addresses">
> However, prefixes provide a visual cue to readers. Because of this,
> software (especially editors) should consider preserving prefixes. For
> example, this is much easier to read:
>   <xsl:stylesheet version="1.0"
>                   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                   xmlns:html="http://www.w3.org/TR/xhtml1/strict">
>   <xsl:template match="/">
>      <html:html>
>         <html:head><html:title>Title</html:title></html:head>
>         <html:body>
>            <xsl:apply-templates/>
>         </html:body>
>   <xsl:template>
>   ...
>   </xsl:stylesheet>
> than this:
>   <aaa:stylesheet version="1.0"
>                   xmlns:aaa="http://www.w3.org/1999/XSL/Transform"
>                   xmlns:bbb="http://www.w3.org/TR/xhtml1/strict">
>   <aaa:template match="/">
>      <bbb:html>
>         <bbb:head><bbb:title>Title</bbb:title></bbb:head>
>         <bbb:body>
>            <aaa:apply-templates/>
>         </bbb:body>
>   <aaa:template>
>   ...
>   </aaa:stylesheet>
> or (much worse yet) this:
>   <html:stylesheet version="1.0"
>                   xmlns:html="http://www.w3.org/1999/XSL/Transform"
>                   xmlns:xsl="http://www.w3.org/TR/xhtml1/strict">
>   <html:template match="/">
>      <xsl:html>
>         <xsl:head><xsl:title>Title</xsl:title></xsl:head>
>         <xsl:body>
>            <html:apply-templates/>
>         </xsl:body>
>   <html:template>
>   ...
>   </html:stylesheet>
> In spite of this, people are likely to read significance into
> prefixes, so
> it is a good idea to use prefixes appropriate to their XML namespace,
> such
> as xslt for the XSLT namespace.
> 
> Reema Duggal
> 
> 
> 
> ------------------------------------------------------------------
> 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.