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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XML and XPATH: How do they work?

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Re: [xml-dev] XML and XPATH: How do they work?
  • From: Alexander Johannesen <alexander.johannesen@gmail.com>
  • 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@mx.gmail.com>
  • References: <514a17f5050628033555ee4b93@mail.gmail.com> <42c13779.60d70a65.58d7.ffff8d60SMTPIN_ADDED@mx.gmail.com>
  • Reply-to: Alexander Johannesen <alexander.johannesen@gmail.com>


On 6/29/05, Joe Schaffner <schaffner.joe@gmail.com> 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 id="some.id.y">
  <label lang="en">Chin</label>
  <label lang="no">Hake</label>

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" />

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" :)

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS