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


Help: OASIS Mailing Lists Help | MarkMail Help

office-collab message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Mis-information on XPath - my bad

Hash: SHA1


I'm afraid that I gave the wrong impression about XPath information
for change tracking in my earlier post showing the various paths in
the ODF standard's content.xml.

For example, in Svante's test document, he used an application (I
won't say its name), which reported an XPath of:


If that is what Camilla objects to, I'm on her side. That's just way
too verbose and ugly.


After realizing that what Svante's wants to point to is a counting of
the text:p elements, then the span element following the ninth p
element, I produced the following XPath statement:


I show the entire XQuery so you can see the opening "(" in front of doc.

What this means is to read content.xml and then count the text:p
elements, wherever they are found "//", count to the ninth [9] p:text
element and then select the first [1], text:span element. The content
of which is A.

Since the equivalent of (doc("content.xml") is going to be supplied by
the application, the recorded XPath to be exchanged would look like:


and you could default the namespaces:


Assuming you document that we are reading text:p as a counted
"component" (the parens around doc to the //) - then this notation
isn't all that different from Svante's.

Well, one substantial difference from Svante's is that every
conformant XPath application (such as XSLT and XQuery engines) will
today give you the same result. An existing base of applications that
already use and understand this notation.

Oh, that was my second mistake in talking about XPath. I was never
suggesting all of XPath but only the descendant axis and then only
with positional predicates "[0-9]".

Which an application could further simplify if it chooses to do so
internally but externally it should still serialize to XPath.

My bad.

I need to look more closely at the XQuery Update language, which I
like, except for its implication that the document instance is in fact
being changed. Necessary more than 25 years ago when the markup
adventure started but its time we stop pretending we are have to
operate in the lower 640K of memory.

Hope everyone is having a great week!



If you want to test the XQuery I wrote:

declare  namespace text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"

for $text in (doc("content.xml")//text:p)[9]/text:span[1]
return string($text)

PPS: Does anyone have a list of all (most of the projects using ODF)?

I ask because SourceForge reports 53 and Github says 216. Other places
I should be looking?

I did see joeffice.org the other day but it uses OOXML. If change
tracking cuts across the formats, might be interesting to ping them.

- -- 
Patrick Durusau
Technical Advisory Board, OASIS (TAB)
OpenDocument Format TC (OASIS), Project Editor ISO/IEC 26300
Co-Editor 13250-5 (Topic Maps)

Another Word For It (blog): http://tm.durusau.net
Homepage: http://www.durusau.net
Twitter: patrickDurusau

Version: GnuPG v1


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]