OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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