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 ]

Hi Joe,

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>

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


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