RE: Annotations in XPath-NG? (Re: XPath/XSLT 2.0 co
Yah Jeni, I am really talking about annotations at the domain level [If you were at my presentation at eXtreme, this is all relevant to that topic]. We've got the content marked up with annotations, and now we want somewhat better infrastructure so as to make it easier to generate/process the information we are producing. I've also got the problem that the collection of annotations can grow arbitrarily large, and many will be in separate documents. For practical reasons, I cannot force the use of a single source document for annotations, although I can restrict annotations to be within the collection or parent collections. Back to XPath-NG: The notion of XPath extensions that support nodes above the document [i.e., collection nodes and repository nodes] would be pretty useful. For example, we want to be able to create an XPath expression that searches a specified collection or document within a collection. So (in the following, treat fsname() as a name test where the argument is a node name in a filesystem instead of a QName [so you can have spaces, et cetera in your names]): Collection::fsname("bar")//foo ; find all foo elements in documents that belong to collections with the name "bar". Collection::fsname("bar")/Collection::fsname("baz")//foo ; find all foo elements in documents that belong to collections named "baz" contained within collections named "bar" Collection::fsname("bar")/Document::fsname("quuz")//foo ; find all foo elements in documetns named "quuz" in collections named "bar". Interestingly enough, if your filesystem hierarchy is represented by an XML document of the form: <Collection fsname="bar"> <Document fsname="quuz"/> <Collection fsname="baz"/> </Collection> Then as Gavin would say: It's just a simple matter of transformation and you are done. Implementation should be a cinch. keith
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format