I'm not sure where XPath comes into this. As far as I can
see the task you are engaged in is deciding how to represent your data in XML
form. That's a question of data modelling, and then translating the data model
into an XML schema or DTD (either explicit or "in your head").
XPath only comes into play when you start processing the
data.
It seems your concern is how to define relationships
between elements in your data. Some people believe strongly that every object in
your model should have a URI and all relationships should be expressed using
that URI. My personal view is, use whatever name or key arises naturally in the
application. So don't do
<next>http://modern-greek-verbs.tripod.com/agapao.xml</next>
instead do
<next>agapao</next>
since that's a sufficient identifier. You can worry about
how to render this as a hyperlink when the time comes to consider transforming
the XML into HTML.
I'm actually wondering whether this <next> element is
needed in your XML at all? Does it hold any information that couldn't be
reconstructed from other things in the XML, or is it just a navigation aid? If
the latter, it may be better to leave it out entirely.
Michael Kay
http://www.saxonica.com/
Hello Everybody,
I'm writing a dictionary of modern Greek verbs at http://modern-greek-verbs.tripod.com
The pages are linked using html anchors, like this:
-- from grafo.html
<a
href="agapao.html"><i>Type</i></a>
'áãáðÜù' is the next verb on the list of linked
pages.
'Type' is the name of the list, a singularly-linked,
circular list. There are three types, 'ëýíù', 'áãáðÜù' 'èåùñþ', and therefore
three pages in this list.
I was wondering how such a list would appear in an xml version of
the dictionary.
Do I do the lists in XPath?
HTML hyperlinks rely on the appearance/layout of the page. They're
simply grouped together. A student knows which links to follow by looking
at them.. but a processing program must know the name of the list.
Within each Type there are Models:
[<i>Model</i> <a
href="ginomai.html">Prev</a> <a
href="diablepo.html">Next</a>]
[<i>Model</i> <a
href="bafo.html">Prev</a> <a
href="anagrafo.html">Next</a>]
The list is hierarchical. Types are broken down into Models which can
be broken down into sub-models.
The Models are nested from top to bottom. The definition is
recursive...
This verb, ãñÜöù, is part of the ëýíù Type, and falls between
other Models ãßíïìáé and äéáâëÝðù, in alphabetical order...
ãñÜöù has two sub-models (verbs which are conjugated like ãñÜöù): âÜöù,
and áíáãñÜöù, the compounds of 'ãñÜöù'...
Of course, 'ãñÜöù' is also an instance of itself. It is a real verb, in
addition to being a model for others.
I'm thinking something like this:
-- This file is 'grafo.xml' which is
on the 'luno.xml' list
<type>
<next>http://modern-greek-verbs.tripod.com/agapao.xml</next>
<model>
<prev>http://modern-greek-verbs.tripod.com/ginomai.xml</prev>
<next>http://modern-greek-verbs.tripod.com/diablepo.xml</next>
<model>
<prev>http://modern-greek-verbs.tripod.com/bafo.xml</prev>
<next>http://modern-greek-verbs.tripod.com/anagrafo.xml</next>
</model>
</model>
</type>
But I don't want to invent my own language. I'm hoping XPath will do the
trick. I've been reading the documentation, which is very large, and I haven't
really found any good examples.
Thanks. I'm sure you can save me a load of time.
Signed,
xml-newbie
|