[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Enlightenment via avoiding the T-word
- From: "Fuchs, Matthew" <matthew.fuchs@commerceone.com>
- To: 'Nicolas LEHUEN' <nicolas.lehuen@ubicco.com>,"'xml-dev@lists.xml.org'" <xml-dev@lists.xml.org>
- Date: Thu, 30 Aug 2001 10:34:45 -0700
Nicolas,
Close, but I think where you're on the wrong track is that the "autmatically
generate unique name" is a uniquely _qualified_ name (i.e., ulabel), not a
unique local name, as you have below. That way we can can exploit
namespaces. Just as the bar member of the Foo class of the Baz package has
the locally unique name bar and the globally unique name Baz.Foo.bar. The
Baz.Foo part is the equivalent of the namespace, so bar is the label, and
Baz.Foo.bar is the ulabel. You only need the ulabel for disambiguation. So
if we're talking about the "name" that's local to "person" in the "example"
namespace, then we've create an "example/person" namespace and put "name" in
it. Assuming the "example" namespace has the prefix "Ex" and the
"example/person" namespace has the prefix "ExP", your examples can be:
> -----Original Message-----
> From: Nicolas LEHUEN [mailto:nicolas.lehuen@ubicco.com]
> Sent: Thursday, August 30, 2001 12:33 AM
> To: Fuchs, Matthew; 'xml-dev@lists.xml.org'
> Subject: RE: Enlightenment via avoiding the T-word
>
>
> That's an interesting point. Giving unique name to local
> elements looks to
> me pretty much as a task a validator could perform, the
> result being shoved
> into a <i>kind of</i> PSVI. Indeed, to me, a good candidate
> for a unique
> name would be the canonical XPath of the local element in a
> valid document,
> or better, the canonical XPath of the local element relative
> to the global
> element containing it.
>
> If you give an automatically generated unique name to a local
> element (like
> Java compiler do with inner classes, be it anonymous or not),
> I suspect our
> template :
>
> <xsl:template match="person/name"/>
>
This is fine, as "name" is unique in person.
> (name being a local element defined in the person global element)
>
> would become :
>
> <xsl:template match="__unique__person__name"/>
>
If you want to refer to "name" outside of the scope of "person" you'd need:
<xsl:template match="ExP:name"/>
> Or something like that. However, in the second sample, in
> which we wanted to
> process the buyer's name and the seller's name in different ways, the
> template :
>
> <xsl:template match="buyer/person/name"/>
>
Once again, this is fine. Or to be more specific (if there are various
"person"'s floating around:
<xsl:template match="buyer/Ex:person/name"/>
> Becomes :
>
> <xsl:template match="buyer/person/__unique__person__name"/>
>
> or :
>
> <xsl:template match="buyer//__unique__person__name"/>
>
Neither of these are necessary.
> So, finally, what is the benefit ?
>
Does it make more sense now?
Matthew