write out part of the loaded schema [message #71612] |
Tue, 20 February 2007 19:57  |
Eclipse User |
|
|
|
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?
|
|
|
Re: write out part of the loaded schema [message #71631 is a reply to message #71612] |
Tue, 20 February 2007 20:23  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Atish,
There are no built-in utilities to do this.
Atish Das wrote:
> 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?
>
>
>
|
|
|
Re: write out part of the loaded schema [message #602137 is a reply to message #71612] |
Tue, 20 February 2007 20:23  |
Eclipse User |
|
|
|
Atish,
There are no built-in utilities to do this.
Atish Das wrote:
> 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?
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04508 seconds