Expressing 2- and 3-D coordinates
Ed Shaya
Edward.J.Shaya.1 at gsfc.nasa.gov
Wed Dec 14 10:55:48 PST 2005
Brian points out to me that Xalan XSLT has some trouble with lists.
Specifically, it is not clear how to split it into components and
address items in it.
The following page:
http://www.xml.com/pub/a/2003/05/07/tr.html
shows how to use the Xpath2 functions tokenize, to split a list, and
index-of, which returns where in a list a specific value is found. It
mentions that Saxon implements these. Saxon also has item-at to select
an item in a list,
Here is the XPATH2 specification of tokenize and index-of
http://www.w3.org/TR/xquery-operators/#func-tokenize
http://www.w3.org/TR/xquery-operators/#func-index-of
Now, the real trouble seems to be that Xalan has not yet moved up to
Xpath2. However, there is an extension
library. And to get the tokenizer one needs to add the namespace
xmlns:str="http://exslt.org/strings"
Here is tokenize described in Xalan:
http://xml.apache.org/xalan-j/extensionslib.html#tokenize
Yet, there is another small issue and that is that the tokenizer works
with strings, so one may needs to cast the item as a string first. An
extra line, but to compensate for this tokenize allows arbitrary
delimiters. Therefore a list of strings with spaces in items can be
declared simply as a string and then split by semi-colons or whatever.
Ed
More information about the dm
mailing list