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]

RE: Namespace prefixes



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@riskinc.com [SMTP:ReemaD@riskinc.com]
> Sent:	Thursday, August 09, 2001 7:10 AM
> To:	xml-dev@lists.xml.org
> 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@lists.xml.org