Ben Bangert wrote:
>That's actually exactly what XQuery is for. If you want some
>programmatic power with XML manipulation and query, its really hard to
>beat XQuery, especially if you're using a XML database. Consider
>querying an XML database, pull bits of the response, and presenting
>them, all handily done in a single XQuery loop:
>
> for $reply in $entry//reply[state = $states]
> return <dd>{ $reply/author/name/last/text() }</dd>
>
>$entry in this case is assumed to be the XML document being operated
>on.
>
>Granted XQuery is odd, and yet another language.... but if you're heavy
>into XML, and want to use XML files with XPath queries and do a little
>manipulation on the output (for HTML), I don't know how you can get any
>better than an expression based language that treats XML as first-class
>objects.
>
>
I've never heard of XQuery, but as you said, that is yet another language.
I'm creating something for python, and hopefully for turbogears if
people want it.
I never said anything about databases, IMHO xml databases are a silly
idea, xml is not ment as a mass storage medium, and is terribly
inefficient at it.
>If you want to stick with as much Python as possible, I'd be more
>inclined to suggest lxml as you get full XPath 1.0 queries as well as
>XSLT capabilities. Though the thing that annoys me about both
>ElementTree and lxml is that they don't implement__str__ method that
>dump the data as a string (which would be awesome when using ET/lxml
>nodes in template languages); instead you have to call another function
>on them to dump their contents. That feels pretty odd to me as I'd
>expect the objects themselves to either give me the string data with
>__str__ or have a function attached that can dump the data.
>
>
I do support __str__ ;-)
>I should also mention, if you're building web-apps with XML data that
>people are giving you, pushing the data into a RDBMS rather than
>keeping it structured in a XML database isn't going to help. Why not
>keep the XML as XML, and use an XML database that lets you pull your
>data with XPath expressions; then just print out or update nodes as
>needed?
>
Again, I never said anything about pushing to a database, the focus here
is on generating XML from some other processed data (could be from a
database, or some other format).
That makes this more geared towards pulling *from* the database, to
produce the XML.
Now, I do plan on adding a parser to XMLModel, so that once you've
defined your model. You can use a 'parse()' class method to return you
an instance with all the data filled in, from a conforming XML document.
But that is in the future.
Sean
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---