Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - Re: [xml-dev] Here's what I've learned over the last several months [Thread Next] Re: [xml-dev] Here's what I've learned over the last several monthsTo: alavinio@-----.--- Date: 4/30/2009 3:22:00 PM Hi, alavinio@g... a écrit : > There are already ways to reach non-XML data from XML tools that don't > require changing the specification, or even writing special > transformation steps. There are lots of examples of tools that work that way: for example when you "parse a catalog" in RefleX, it can be an SGML catalog or an OASIS XML catalog, the former will be transformed on the fly to XML. Fine. This works well as long as the source to convert is something like a text (CSV, EDI, JSON, etc). However producing XML markups is not the best solution. For example, if you had to represent in XML a file system, and that you had to get (with XPath or XQuery) the modification date of the last file (in sequence) of the last directory (in sequence) under the root directory, this strategy is extremely inefficient because you'd have to recursively build the markup of the entire file system and nowadays they are somewhat huge. It is much more better to deal with the data model and just handle the root directory as an XML item and navigate inside during the evaluation of the XPath or XQuery query. That way you will reach the expected data without having to browse the entire tree. In RefleX you can have it with XPath like this: io:file('file:///')/*[last()]/*[last()]/@io:last-modified People tend to think about XML as markups only, whereas it is much more valuable to think about XML as its data model: markups are intolerant, the data model more flexible. For example, when you have an XML attribute that contains an xs:date, you can store it in the $myDate variable: someElem/@someDate it would be very usefull to have the ability to extract fields from $myDate: $myDate/@year and in short: someElem/@someDate/@year note that this is syntaxically correct regarding the XPath spec. but everybody would say that the result of such expression is empty. RefleX is a tool that works that way, and you can bind any arbitrary object to an XML attribute. Consider this: <file uri="file:///"/> if I had a schema that indicates that the type of my "uri" attribute is an "io:x-file" ("x-" denotes types of XML-aware objects in RefleX), then I can apply the XPath expression: @uri/*[last()]/*[last()]/@io:last-modified I gave a presentation at Balisage in 2008 about all that stuff and more amusements around schemas: "Properties of schema mashups: dynamicity, semantic, mixins, hyperschemas" You will find the paper and the slides here: http://reflex.gforge.inria.fr/balisage2008.html Regards -- Cordialement, /// (. .) --------ooO--(_)--Ooo-------- | Philippe Poulard | ----------------------------- http://reflex.gforge.inria.fr/ Have the RefleX ! _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@l... subscribe: xml-dev-subscribe@l... List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
