I’ve been working with the xml.linq classes in .net recently. But may need to use a linux friendly language for an upcoming project.
The things I like the most are
- Xdocument, being able to load from a
file or parse from a string - XElement, quickly creating a custom
structure for page specific data - Traversing Children, Parents,
Siblings etc - Xml.Linq in general getting and
setting values by
Variable.Element("elementName").value()
for
Variable.Descandants("elementName").value()
not to mention attributes adding
descendants and all the other
goodies that are built in.
So my question is. Is there another language that has these kinds of features built in for xml? I’d like to avoid manual parsing and have the flexibility of on the fly generated xml.
Bonus Question: Do other languages have features that could work similar to Linq to Xml for querying the xDocument/xelement equivalent.
LINQ example thing in Python
http://themechanicalbride.blogspot.com/2007/03/linq-to-python.html
But this blog sheds light on why this is not needed:
LINQ in PHP
http://phplinq.codeplex.com/
For an interesting perspective on LINQ and things similar
http://mail.python.org/pipermail/python-3000/2006-November/004575.html
Sounds interesting. But in the FOSS scene, there seems to be a bit of resistance to this kind of thing (I could be wrong).
There are tons of XML routines in Python such as XPath, XSLT and others.
How to use Xpath in Python?
It might be worth working with these standards and moving away from LINQ as, I cant see a stable alternative … But there are things that are functional, but a different philosophy