Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » write out part of the loaded schema
write out part of the loaded schema [message #602120] Tue, 20 February 2007 19:57
Eclipse UserFriend
Originally posted by: Atish.Das.ugs.com

I am using XML Schema Infoset to load a "myschema.xsd". Once it is loaded I
would like to create sub xsd files that contain a sub set of the elements
loaded from "myschema.xsd". The subsets that I want to write out may have
dependent complex types which should also needs to be written out.
For example. Here is my xsd-
<xsd:complexType name="MyType">

<xsd:complexContent>

<xsd:extension base="xyz:MyBaseType">

<xsd:attribute name="arch_type" type="xsd:string" />

<xsd:attribute name="arch_elem_id" type="xsd:string" />

</xsd:extension>

</xsd:complexContent>

</xsd:complexType>

<xsd:element name="MyElement" type="xyz:MyType" />

<xsd:complexType name="MyBaseType">

</xsd:complexType>

XSDSchema schema = loadSchema("myschema.xsd")
Resource mysubset = resourceSet.createResource("mysubset.xml")
XSDElementDeclaration element= (XSDElementDeclaration )
schema.getElement...("MyElement");
mysubset.getcontents().add(element)
resource.save(null)

Here when I save "MyElement" I would like to have all its depndents
"MyBaseType" and "MyType" also saved.
The only way I can do this, is I resolve these dependencies and add them to
the resource and save it.

Is there a convenient way in Schema Infoset to save a subset of the loaded
schema?
Previous Topic:[Announce] EclipseCon 2007 Registration
Next Topic:write out part of the loaded schema
Goto Forum:
  


Current Time: Fri Dec 19 08:57:09 GMT 2014

Powered by FUDForum. Page generated in 0.15530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software