|How to update imported schema files [message #602733]
||Thu, 06 December 2007 21:28
Registered: July 2009
I have a requirement to open a XSD schema file that has references to |
other schemas by 'import', add my attributes to some types defined in the
imported schemas, and finally save these changed schemas. To simplify the
case, the imported schemas are assumed to be all in the local file system
and are editable. I have no problem loading the main XSD, parsing it to
locate the DOM objects that I want to add my own attributes to and update
it. Everything is going on well but I can't save the changes I made to the
definitions to the imported schemas.
As an example:
I open the main schema, A.xsd which imports B.xsd that imports C.xsd. In
C.xsd, a type is defined as:
<xsd:element name="description" type="xsd:string"/>
What I need to do is to change this definition to:
<xsd:element name="description" type="xsd:string" myOwnAttribute="value"/>
And finally save this change.
I then try to serializ the DOM of the main schema, hoping to save the
change to C.xsd.
I loaded the main schema from A.xsd which internally populated all the
type definitions from imported B.xsd and C.xsd. But when I serialize the
edited DOM object, C.xsd is not being saved with the added attributes
because C.xsd was never explicitly loaded. In fact, only schema defined in
A.xsd is saved.
When all the types are defined in one file, I have no problem saving the
Is there a way to save changes to the imported schemas?
Powered by FUDForum
. Page generated in 0.06267 seconds