Y
Yannick Patois
Hi,
I would like to merge two XML document, or more exacly enrich a document
by inheritiong from another.
I read a bit about XSLT and I know a bit of python/sax/dom, and I dont
know where I should go. I tried xslt, without success yet (but I dont
know much about it) so I failed back on python+dom wher I know a bit more.
I'm asking you if it's a good choice, or if I should use XSLT for this.
Small example of what I want:
File1:
<toto>
<tata>bla</tata>
<titi>bli</titi>
<toto>
File2:
<toto>
<tata>bla bla</tata>
<tutu>blu</tutu>
<toto>
Result:
<toto>
<tata>bla bla</tata>
<titi>bli</titi>
<tutu>blu</tutu>
<toto>
Note that <tata> value has been supereseded by file2 value, and <titi>
added as not present in file2. To me, it must look like OO "inheritance"
property, even if I dont know if this has any meaning for XML.
More concrelty, it's about compilation commands to issue for a given
file, right now I represent them like this (prototype):
<package name="default">
<spi_configure>
<command name="./configure" argument="$SPI_PREFIX"/>
</spi_configure>
<spi_make>
<command name="make" />
</spi_make>
<spi_makeinstall>
<command name="make" argument="install" />
</spi_makeinstall>
<spi_check>
<command name="make" argument="check" />
</spi_check>
</package>
<package name="foo" version="1.0.0">
<spi_make>
<command name="make" argument="all" />
<command name="make" argument="dylibs" />
</spi_make>
</package>
The package "foo" build exactly like the default procedure, except that
the make step is a bit different. That's what I need to express by
creating a new xml file containing all the informations. Then I know how
to convert this to bash or whatever using xslt.
Thanks for any help.
Yannick
I would like to merge two XML document, or more exacly enrich a document
by inheritiong from another.
I read a bit about XSLT and I know a bit of python/sax/dom, and I dont
know where I should go. I tried xslt, without success yet (but I dont
know much about it) so I failed back on python+dom wher I know a bit more.
I'm asking you if it's a good choice, or if I should use XSLT for this.
Small example of what I want:
File1:
<toto>
<tata>bla</tata>
<titi>bli</titi>
<toto>
File2:
<toto>
<tata>bla bla</tata>
<tutu>blu</tutu>
<toto>
Result:
<toto>
<tata>bla bla</tata>
<titi>bli</titi>
<tutu>blu</tutu>
<toto>
Note that <tata> value has been supereseded by file2 value, and <titi>
added as not present in file2. To me, it must look like OO "inheritance"
property, even if I dont know if this has any meaning for XML.
More concrelty, it's about compilation commands to issue for a given
file, right now I represent them like this (prototype):
<package name="default">
<spi_configure>
<command name="./configure" argument="$SPI_PREFIX"/>
</spi_configure>
<spi_make>
<command name="make" />
</spi_make>
<spi_makeinstall>
<command name="make" argument="install" />
</spi_makeinstall>
<spi_check>
<command name="make" argument="check" />
</spi_check>
</package>
<package name="foo" version="1.0.0">
<spi_make>
<command name="make" argument="all" />
<command name="make" argument="dylibs" />
</spi_make>
</package>
The package "foo" build exactly like the default procedure, except that
the make step is a bit different. That's what I need to express by
creating a new xml file containing all the informations. Then I know how
to convert this to bash or whatever using xslt.
Thanks for any help.
Yannick