Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Help on Extending XSD API to write user specific classes
Help on Extending XSD API to write user specific classes [message #41189] Tue, 13 April 2004 12:29 Go to next message
Eclipse UserFriend
Originally posted by: manohar.babu.gxs.com

Hi,

I am working on the XSD API and trying to extend the classes to add some
more specific functionality. So in this process,I need to have my own
instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
objects where in I am going to add my own methods to address my
requirements.

So I have actually started with that , creating resourceSet
xsdMainResource instances by extending the actually classes from XSD API.
the next step would be creating an instance of schema class, but I could
do that also , the only problem is I am not able to get an properly filled
in schema object where in I could get the element declarations and stuff
like that.

Last time I posted the same problem in the mailing list instead of the
newsgroup. So I am repeated all the steps here ,

First of all I dont know the feasibility of extending the XSD API and
writing my own classes to incorporate my own specific requirements. Last
time Ed, replied saying that , the XSD model was not designed with the
intent that it be
extended, but if required is there any way out to do so.

Please help me out with any ideas on it.

thanks in advance
Manohar
Re: Help on Extending XSD API to write user specific classes [message #41225 is a reply to message #41189] Tue, 13 April 2004 13:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Manohar,

The Metamatrix folks have done something like this, so maybe they want to
share their experience. Personally, I think it's probably better to annotate
the schema and then build a separate model for the annotations, rather than
trying to extend the model itself.


Manohar wrote:

> Hi,
>
> I am working on the XSD API and trying to extend the classes to add some
> more specific functionality. So in this process,I need to have my own
> instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> objects where in I am going to add my own methods to address my
> requirements.
>
> So I have actually started with that , creating resourceSet
> xsdMainResource instances by extending the actually classes from XSD API.
> the next step would be creating an instance of schema class, but I could
> do that also , the only problem is I am not able to get an properly filled
> in schema object where in I could get the element declarations and stuff
> like that.
>
> Last time I posted the same problem in the mailing list instead of the
> newsgroup. So I am repeated all the steps here ,
>
> First of all I dont know the feasibility of extending the XSD API and
> writing my own classes to incorporate my own specific requirements. Last
> time Ed, replied saying that , the XSD model was not designed with the
> intent that it be
> extended, but if required is there any way out to do so.
>
> Please help me out with any ideas on it.
>
> thanks in advance
> Manohar
Re: Help on Extending XSD API to write user specific classes [message #41317 is a reply to message #41225] Wed, 14 April 2004 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manohar.babu.gxs.com

Hi,
I have got an idea after looking at the XSDPrototypicalSchema.java ,
XSDSchemaBuildingTools.java files. Once after getting the schema object ,
I will traverse through that and will try to build my own objects of the
ElementDeclaration and AttributeDeclaration. So I finally I will get a my
own schema object and it has the Elements and Attributes of my own
instances.
So in this process I need to traverse through the schema object twice. But
I am not sure whether this will work or not.
Ed can you please suggest me some idea on this.

thanks,
Manohar

Ed Merks wrote:

> Manohar,

> The Metamatrix folks have done something like this, so maybe they want to
> share their experience. Personally, I think it's probably better to annotate
> the schema and then build a separate model for the annotations, rather than
> trying to extend the model itself.


> Manohar wrote:

> > Hi,
> >
> > I am working on the XSD API and trying to extend the classes to add some
> > more specific functionality. So in this process,I need to have my own
> > instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> > objects where in I am going to add my own methods to address my
> > requirements.
> >
> > So I have actually started with that , creating resourceSet
> > xsdMainResource instances by extending the actually classes from XSD API.
> > the next step would be creating an instance of schema class, but I could
> > do that also , the only problem is I am not able to get an properly filled
> > in schema object where in I could get the element declarations and stuff
> > like that.
> >
> > Last time I posted the same problem in the mailing list instead of the
> > newsgroup. So I am repeated all the steps here ,
> >
> > First of all I dont know the feasibility of extending the XSD API and
> > writing my own classes to incorporate my own specific requirements. Last
> > time Ed, replied saying that , the XSD model was not designed with the
> > intent that it be
> > extended, but if required is there any way out to do so.
> >
> > Please help me out with any ideas on it.
> >
> > thanks in advance
> > Manohar
Re: Help on Extending XSD API to write user specific classes [message #41348 is a reply to message #41317] Wed, 14 April 2004 10:35 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Manohar,

I think it's best to extend the schema language via xsd:appinnfo or via non-schema
namespace attributes. This way your extended schema can be handled by any
conforming processor and you can allow the XSDSchema to be built as normal. You
could then walk the constructed schema and it's components to build objects that
derived from the appinfos or non-schema namespace attributes. Those objects could
be attached as adapters (EObject.eAdapters) to the schema components, and changes
to then could be designed to write themselves out as changes to the DOM that the
schema components wrap.


Manohar wrote:

> Hi,
> I have got an idea after looking at the XSDPrototypicalSchema.java ,
> XSDSchemaBuildingTools.java files. Once after getting the schema object ,
> I will traverse through that and will try to build my own objects of the
> ElementDeclaration and AttributeDeclaration. So I finally I will get a my
> own schema object and it has the Elements and Attributes of my own
> instances.
> So in this process I need to traverse through the schema object twice. But
> I am not sure whether this will work or not.
> Ed can you please suggest me some idea on this.
>
> thanks,
> Manohar
>
> Ed Merks wrote:
>
> > Manohar,
>
> > The Metamatrix folks have done something like this, so maybe they want to
> > share their experience. Personally, I think it's probably better to annotate
> > the schema and then build a separate model for the annotations, rather than
> > trying to extend the model itself.
>
> > Manohar wrote:
>
> > > Hi,
> > >
> > > I am working on the XSD API and trying to extend the classes to add some
> > > more specific functionality. So in this process,I need to have my own
> > > instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> > > objects where in I am going to add my own methods to address my
> > > requirements.
> > >
> > > So I have actually started with that , creating resourceSet
> > > xsdMainResource instances by extending the actually classes from XSD API.
> > > the next step would be creating an instance of schema class, but I could
> > > do that also , the only problem is I am not able to get an properly filled
> > > in schema object where in I could get the element declarations and stuff
> > > like that.
> > >
> > > Last time I posted the same problem in the mailing list instead of the
> > > newsgroup. So I am repeated all the steps here ,
> > >
> > > First of all I dont know the feasibility of extending the XSD API and
> > > writing my own classes to incorporate my own specific requirements. Last
> > > time Ed, replied saying that , the XSD model was not designed with the
> > > intent that it be
> > > extended, but if required is there any way out to do so.
> > >
> > > Please help me out with any ideas on it.
> > >
> > > thanks in advance
> > > Manohar
Re: Help on Extending XSD API to write user specific classes [message #585486 is a reply to message #41189] Tue, 13 April 2004 13:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31536
Registered: July 2009
Senior Member
Manohar,

The Metamatrix folks have done something like this, so maybe they want to
share their experience. Personally, I think it's probably better to annotate
the schema and then build a separate model for the annotations, rather than
trying to extend the model itself.


Manohar wrote:

> Hi,
>
> I am working on the XSD API and trying to extend the classes to add some
> more specific functionality. So in this process,I need to have my own
> instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> objects where in I am going to add my own methods to address my
> requirements.
>
> So I have actually started with that , creating resourceSet
> xsdMainResource instances by extending the actually classes from XSD API.
> the next step would be creating an instance of schema class, but I could
> do that also , the only problem is I am not able to get an properly filled
> in schema object where in I could get the element declarations and stuff
> like that.
>
> Last time I posted the same problem in the mailing list instead of the
> newsgroup. So I am repeated all the steps here ,
>
> First of all I dont know the feasibility of extending the XSD API and
> writing my own classes to incorporate my own specific requirements. Last
> time Ed, replied saying that , the XSD model was not designed with the
> intent that it be
> extended, but if required is there any way out to do so.
>
> Please help me out with any ideas on it.
>
> thanks in advance
> Manohar


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Help on Extending XSD API to write user specific classes [message #585535 is a reply to message #41225] Wed, 14 April 2004 10:00 Go to previous message
Manohar is currently offline ManoharFriend
Messages: 11
Registered: July 2009
Junior Member
Hi,
I have got an idea after looking at the XSDPrototypicalSchema.java ,
XSDSchemaBuildingTools.java files. Once after getting the schema object ,
I will traverse through that and will try to build my own objects of the
ElementDeclaration and AttributeDeclaration. So I finally I will get a my
own schema object and it has the Elements and Attributes of my own
instances.
So in this process I need to traverse through the schema object twice. But
I am not sure whether this will work or not.
Ed can you please suggest me some idea on this.

thanks,
Manohar

Ed Merks wrote:

> Manohar,

> The Metamatrix folks have done something like this, so maybe they want to
> share their experience. Personally, I think it's probably better to annotate
> the schema and then build a separate model for the annotations, rather than
> trying to extend the model itself.


> Manohar wrote:

> > Hi,
> >
> > I am working on the XSD API and trying to extend the classes to add some
> > more specific functionality. So in this process,I need to have my own
> > instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> > objects where in I am going to add my own methods to address my
> > requirements.
> >
> > So I have actually started with that , creating resourceSet
> > xsdMainResource instances by extending the actually classes from XSD API.
> > the next step would be creating an instance of schema class, but I could
> > do that also , the only problem is I am not able to get an properly filled
> > in schema object where in I could get the element declarations and stuff
> > like that.
> >
> > Last time I posted the same problem in the mailing list instead of the
> > newsgroup. So I am repeated all the steps here ,
> >
> > First of all I dont know the feasibility of extending the XSD API and
> > writing my own classes to incorporate my own specific requirements. Last
> > time Ed, replied saying that , the XSD model was not designed with the
> > intent that it be
> > extended, but if required is there any way out to do so.
> >
> > Please help me out with any ideas on it.
> >
> > thanks in advance
> > Manohar
Re: Help on Extending XSD API to write user specific classes [message #585547 is a reply to message #41317] Wed, 14 April 2004 10:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31536
Registered: July 2009
Senior Member
Manohar,

I think it's best to extend the schema language via xsd:appinnfo or via non-schema
namespace attributes. This way your extended schema can be handled by any
conforming processor and you can allow the XSDSchema to be built as normal. You
could then walk the constructed schema and it's components to build objects that
derived from the appinfos or non-schema namespace attributes. Those objects could
be attached as adapters (EObject.eAdapters) to the schema components, and changes
to then could be designed to write themselves out as changes to the DOM that the
schema components wrap.


Manohar wrote:

> Hi,
> I have got an idea after looking at the XSDPrototypicalSchema.java ,
> XSDSchemaBuildingTools.java files. Once after getting the schema object ,
> I will traverse through that and will try to build my own objects of the
> ElementDeclaration and AttributeDeclaration. So I finally I will get a my
> own schema object and it has the Elements and Attributes of my own
> instances.
> So in this process I need to traverse through the schema object twice. But
> I am not sure whether this will work or not.
> Ed can you please suggest me some idea on this.
>
> thanks,
> Manohar
>
> Ed Merks wrote:
>
> > Manohar,
>
> > The Metamatrix folks have done something like this, so maybe they want to
> > share their experience. Personally, I think it's probably better to annotate
> > the schema and then build a separate model for the annotations, rather than
> > trying to extend the model itself.
>
> > Manohar wrote:
>
> > > Hi,
> > >
> > > I am working on the XSD API and trying to extend the classes to add some
> > > more specific functionality. So in this process,I need to have my own
> > > instance of the XSDElementDeclarationImpl and XSDAttributeDeclarationImpl
> > > objects where in I am going to add my own methods to address my
> > > requirements.
> > >
> > > So I have actually started with that , creating resourceSet
> > > xsdMainResource instances by extending the actually classes from XSD API.
> > > the next step would be creating an instance of schema class, but I could
> > > do that also , the only problem is I am not able to get an properly filled
> > > in schema object where in I could get the element declarations and stuff
> > > like that.
> > >
> > > Last time I posted the same problem in the mailing list instead of the
> > > newsgroup. So I am repeated all the steps here ,
> > >
> > > First of all I dont know the feasibility of extending the XSD API and
> > > writing my own classes to incorporate my own specific requirements. Last
> > > time Ed, replied saying that , the XSD model was not designed with the
> > > intent that it be
> > > extended, but if required is there any way out to do so.
> > >
> > > Please help me out with any ideas on it.
> > >
> > > thanks in advance
> > > Manohar


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:schema loading problems
Next Topic:traversing hierarchy of particles
Goto Forum:
  


Current Time: Tue Oct 20 02:02:22 GMT 2020

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

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

Back to the top