On 10/13/07, tnoo <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> Coming from Cocoon I have a bunch of XML files laying around. Is it
> possible
> to easily read those, instead of reading the data from a database? I
> am aware
> of elementtree to get the XML into a useful Python class, but how to
> best
> proceed formt there?

Well, it depends. :-)

Django has an XML importer, but it requires that the XML is in a
particular format. If you have any control over the schema for the XML
data, or you are an expert XSLT author, you may be able to convert the
XML into a format that Django can import directly.

If you don't have any control over the XML format, you will need to
iterate over the 'objects' in the XML, construct a Django analog for
each of those objects, and save to the database. ElementTree is well
suited to doing this sort of iteration, as are any number of other XML
APIs. However, without specific details on the format you are using,
it's difficult to give more specific advice.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to