Writing a gui to map foreign XML <> local XML in python

C

Christopher Boomer

I am relatively new to the world of XML and python, and I think I am still
missing some of the basic concepts. It cannot be as hard as I think, or
programmers would be flocking to it the way they are.

We are developing a system based on Zope & Postgres, and want/need to use
XML as our default output language to allow us to communicate with other
companies. I have devised a local XML format which meets our needs, and
which works well with our database, using XSLT to generate SQL statements
and a Zope template to create the outbound XML.

I have devised an XSLT method to translate from a known foreign XML format
to the local XML format. Now I need to be able to let others define the
relationship from new foreign documents using a gui. I cannot rely on DTDs
or schemas because the companies themselves do not all produce them, and I
have yet to even formalise ours.

My thought was to generate a flat dictionary representation of the foreign
and local formats with the absolute Xpath expression as dictionary key. The
user is presented with a list of elements&attributes in the local file and
asked to select the foreign element|attribute fills that role. I could then
use the keys from this mapping to generate XSLT which can be stored.

Using dictionary keys means that duplicate elements will be lost, but this
is not problematic since I am attempting to map the structure not the
content. What are the other implications of this approach? Or is there an
easier way to do it, that I know nothing about?

And has anyone written such a thing, even in part?

Many thanks,
Christopher Boomer
Belfast.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top