Tim Jansen's blog


2004/06/13
XML Operators
For a long time I wanted to use E4X's operators for XML operations, but now I changed my mind: I think it's a bad idea to use '.' for accessing child elements. One problem is that you can't tell '.' for property access from '.' for child elements. But even worse is that re-adding a property later to a class that uses '.' for child elements would break source code. So another operator for child elements is needed. I think the best alternative is '..' (used by E4X for accessing descendants). My replacement for E4X's '..' is '.~', probably. Because of typed NodeLists (see last entry) I also need another operator to narrow down a NodeList and make it typed, and '.?' looks good for that. So the list of XML operators is
  • '..' + QName to get all children with the given QName
  • '.~' + QName to get all decendants with the given QName
  • '.@' + QName to get the value of the attribute with the given QName
  • '.?' + QName to remove all nodes from a list that are not elements with the given QName
  • '.()' to keep only those elements in the list, that fulfill the given conditon (filter)


 

This blog is my dumping ground for thoughts and ideas about Eek. Someday Eek will be a programming language and system, somewhat comparable to Java in scope. It is my attempt to bring sanity to the world of computing.
At least I hope so. Right now it is far from being finished and I can't guarantee that it ever will be. I am still working on the specification, but I won't release anything before I got my first prototype running. The world does not need more vapourware and unusable beta-software. All publicly available information about Eek is contained in this blog. You can find the latest summary here.
This page is powered by Blogger. Isn't yours? Creative Commons License
This work is licensed under a Creative Commons License.