- From: Joshua Allen <joshuaa@microsoft.com>
- Date: Mon, 22 Apr 2002 22:19:49 -0700
- To: <jimbofc@yahoo.com>, <uri@w3.org>
Why not use XPath to traverse the children positionally? This is very simple syntax -- for example, the <child4> element in your paper would be: exa://ROOT/2.1/3.1/4.3/5.1 or in XPath: /*[1]/*[1]/*[1]/*[3]/*[1] or in abbreviated XPointer syntax: (http://www.w3.org/TR/2001/CR-xptr-20010911/#child-seqs) /1/1/1/3/1 Now, if you look more closely, you will notice that your exa: syntax has some redundant information. Doesn't it seem interesting that the second path segment is prefixed by 2, the third by 3, and so on? I bet you will find that the LN number always starts at two and increments by one. So let's take a look at your syntax with the redundant data removed: exa://ROOT/1/1/3/1 Hmm, this is very interesting. One slight thing we could do for consistency's sake could be to do something about the ROOT syntax. Since the root element will *always* have a LN of 1 and a SN of 1, the syntax would be (putting back in the redundant information): exa://1.1/2.1/3.1/4.3/5.1 Now let's take out the redundant information like we did before: exa://1/1/1/3/1 Oops! That is the exact same syntax as XPointer. Now let's suppose we are worried about what would happen if someone got confused and thought the *name* of an element was "3" instead of the position. We could make it absolutely clear that we are referring to position instead of name by using the position syntax of XPath: exa://*[1]/*[1]/*[1]/*[3]/*[1] Regards, Joshua Allen Microsoft WebData XML 425.705.7857 > -----Original Message----- > From: Jimmy Cerra [mailto:jimbofc@yahoo.com] > Sent: Monday, April 22, 2002 4:32 PM > To: uri@w3.org > > Hi all. > > I'm writing a MathML-Presentation processor in JavaScript, and I needed a > way to > transverse the document tree. Xpath is too complicated (at least for me > and my > little project), so I devised a location-path for each element in the XML > document in the form as a URI. > > The details can be found here: http://www.pitt.edu/~jfcst24/exa-RD.txt I > only > intend to use this for my projects involving the processor that I choose > (Xparse.js). Still, it is useful to have a specific reference to program > to; > hence the reason I wrote this. > > What problems do you see with this scheme? > > --- > Jimmy Cerra > >
Received on Tuesday, 23 April 2002 01:20:35 UTC