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

Re: XML and XPATH: How do they work?

  • To: xml-dev@l...
  • Subject: Re: XML and XPATH: How do they work?
  • From: Alexander Johannesen <alexander.johannesen@g...>
  • Date: Thu, 30 Jun 2005 10:21:23 +1000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CCERXtUqNgQsUd16Vfr9BSGk++IaaJ/m9/PwEGh07IjgGhBgMmu6+YWaNAZbzaItfL7QUgsxTQzuiIiLQnKx5PcQgdl9itjsxFwlMU7Jh/npYwbbaHzVX92iaXPjMaACQwa6G+8rMwpB1IYximT4u705vuzYaqFGkSVZJCiaOI4=
  • In-reply-to: <42c13779.60d70a65.58d7.ffff8d60SMTPIN_ADDED@m...>
  • References: <514a17f5050628033555ee4b93@m...> <42c13779.60d70a65.58d7.ffff8d60SMTPIN_ADDED@m...>
  • Reply-to: Alexander Johannesen <alexander.johannesen@g...>

Re:  XML and XPATH: How do they work?
Hi,

On 6/29/05, Joe Schaffner <schaffner.joe@g...> wrote:
> XPath looks like some kind of expression language for naming objects, as in
> "pathname", not a "link". (I'm guessing that XML objects, being
> hierarchical, need some kind of name syntax, like a "pathname".)

Not sure what an XML object might be, but xPath is simply a query
language for traversing node-trees, and a very good one as such.

> The 'link' abstraction in XML is a bit more complicated than I expected, so
> I'll need more time to read the documentation.

Of course, that depends on just how you model and want to implement your data.

> My names <prev> and <next> come from linked list programming in C. They are
> unidirectional, so you need one for both directions. They serve as
> navigation.

Navigation should not be part of your datamodel nor dataset, but be a
separate implementation detail. Here's how I'd do your XML stuff;

<term id="some.id.x">
  <label lang="en">Fiddle</label>
  <label lang="no">Fele</label>
</term>

<term id="some.id.y">
  <label lang="en">Chin</label>
  <label lang="no">Hake</label>
</term>

And when you need a relationship between the two;

<relationship of.type="played.on">
  <member refid="some.id.x" role="instrument" />
  <member refid="some.id.y" role="method" />
</relationship>

Then it makes sense to just create a set of words that describe your
relationships (of.type and role attributes) (also known as an
ontology). This can now all come together in a user interface without
any hardwireing.

You may want to look at canonical XML for a better understanding of id
and refid attributes and somesuch. xLink is when you need (well,
mostly) cross-document linking, and *especially* cross-domain
cross-linking. Basically my advice would be to keep it simple unless
you really have to.

> But they are also logical, maintaining either alphabetical order, or the
> arbitrary order chosen for the models...

These should be part of the interface logic of your application, not
be an integral part of datamodel nor dataset.

> It looks like there is more than one way to skin a cat.

There are often too many, which makes the simple solution hidden.
"When facing the sunshine, you won't see the shadows" :)


Alexander
-- 
"Ultimately, all things are known because you want to believe you know."
                                                         - Frank Herbert
__ http://shelter.nu/ __________________________________________________

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.