Posts

Showing posts with the label xsd

Using xslt to transform multiple xml schema documents

Using xslt to transform multiple xml schema documents I have a number of xml schema documents which are used to describe configuration settings for my application. The xml schemas look something along the following lines: Client.xsd <xsd:schema targetNamespace="http://www.example.com/network" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Client"> <xsd:attribute name="Host" type="xsd:string> </xsd:complexType> </xsd:schema> Server.xsd <xsd:schema targetNamespace="http://www.example.com/network" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Server"> <xsd:attribute name="Port" type="xsd:unsignedShort> <xsd:attribute name="MaxConnections" type="xsd:int default="32"> </xsd:complexType> </xsd:schema> Appli...

What is the best way to implement an application in Java that converts xml in one format into another? [on hold]

What is the best way to implement an application in Java that converts xml in one format into another? [on hold] I have to write an application that processes a large amount of xml files and transforms xml defined by xsd1 to xml defined by xsd2. The xsd1 file will change frequently during the project. The single xml file is at most 200Kb. There will be a lot of business logic in a transformation. I would like to be as close as possible to the Java standard libraries. What would be the best approach to implement this application in terms of the xml file processing? Should I use in this case DOM,SAX,JAXB,XPATH or something else? To be more precise the only change that might happen is addition of the anonymous inner elements in the xsd, so that there will be for example multiple times an anonymous inner element item defined, which results in Item1,Item2,...,ItemN classes generated. When the new anonymous Item3 is added then Item1 becomes Item3 and every occurrence in code of Item1 has to ...