Re: [q-lang-users] Avoiding trailing () in CGIs
Brought to you by:
agraef
From: <Dr....@t-...> - 2004-07-04 22:08:50
|
Tim Haynes wrote: > Well, at some future date I would like to be able to read in arbitrary, > possibly large-ish, XML documents, have them parsed into an accessible > structure and then be able to perform xpath/xquery queries on them to > isolate node(s). Yes, I see. Well it should be possible to write a sablotron wrapper which gives access to the internal data structure so that you can carry out these queries. Or even map the internal structure into a Q term. > Oh, ordered dictionaries as well? That would be great. I think we're talking about different things here. Q's ordered dictionaries are just dictionaries for key values on which an order is defined (such as strings, lists or numbers). They are implemented as AVL trees. Hashed dictionaries do not require this order, as the key values are hashed to give an integer which is used as the actual key in the AVL tree, the associated values are buckets (lists) of table elements with the same key. Both structures can be nested, of course. > I was wondering, earlier, what the most appropriate data-structure would be > for storing such a set of XML nodes, facilitating rapid random access. I'll > have a look through those sections imminently. Well, if you need random access to the components of an xml tag, then nested dictionaries could work reasonably well. But if sablatron already has all the xpath indexing facilities that you need, then it would probably be easiest and most efficient to just expose the internal data structure which sablotron uses to represent xml, as an external type in Q, and provide the necessary access operations in a Q->C module. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikwissenschaft.uni-mainz.de/~ag |