Re: o:xml arrays ?
Martin Klang <[email protected]> Fri, 23 Jul 2004 14:30:01 +0100
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Mark, I don't think that arrays are necessary as first class constructs in o:XML - but I could be wrong! There is a core type for representing two-dimensional arrays called Table, and a (not yet finished) Array type for n-dimensional arrays. They can both be implemented using 'normal' arrays in the target language, ie Table is implemented in ObjectBox using Java arrays. In XPath you can retrieve the x-th node of a nodeset with '[x]', which is a predicate but looks and mostly acts as array operators in other languages. My intention with the Array type is to allow access to array elements or sub-arrays in the same way, eg: <o:set array="Array(3,3)"/> <!-- produce a 3x3 array --> <o:set subarray="$array[1]"/><!-- get the first row --> <o:set element="$array[1][1]"/><!-- get the first element --> The types provide an extensible, polymorphic interface to lower-level language constructs such as arrays, which I think is more useful than direct language support. For example the Array type can include matrix manipulation functions like transpose, invert etc. Java or C arrays are powerful and efficient but not very practical to work with - similar maybe to pointers. If you use the Java language extensions, there are ways of converting Java arrays to Lists, and to produce Java arrays from o:XML. I intend to improve this by integrating Java extensions with the Array type in the future. hope this answers your question, regards, /m On 23 Jul 2004, at 13:42, Mark Horowitz wrote: > > are arrays a current, future, or nonexistent part of o:xml ? > > mark horowitz > a.s.a., scjp > towers perrin > ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________