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

RE: Enlightenment via avoiding the T-word

  • From: "Fuchs, Matthew" <matthew.fuchs@c...>
  • To: 'Nicolas LEHUEN' <nicolas.lehuen@u...>,"'xml-dev@l...'" <xml-dev@l...>
  • Date: Thu, 30 Aug 2001 10:34:45 -0700

unique name java
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@u...]
> Sent: Thursday, August 30, 2001 12:33 AM
> To: Fuchs, Matthew; 'xml-dev@l...'
> 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

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.