Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » generating sample xml from xsd
generating sample xml from xsd [message #31164] Wed, 01 October 2003 22:17 Go to next message
Eclipse User
Originally posted by: cipher8000.yahoo.com

Hi,

Is there any util classes to generate sample xml from an xsd file? i know we
can use EMF to generate sample xml but it works with only eclipse UI...i am
looking for a stand-alone library to generate sample xml.

thanks
-muruga
Re: generating sample xml from xsd [message #31199 is a reply to message #31164] Wed, 01 October 2003 22:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Muruga,

Generating XML instances would be a very cool stand-alone application for the
XSD model, but we haven't done that yet. It's an interesting and somewhat
open-ended problem. Are you considering building one using XSD or are you just
looking for one that already works?


Muruga Chinnananchi wrote:

> Hi,
>
> Is there any util classes to generate sample xml from an xsd file? i know we
> can use EMF to generate sample xml but it works with only eclipse UI...i am
> looking for a stand-alone library to generate sample xml.
>
> thanks
> -muruga
Re: generating sample xml from xsd [message #31232 is a reply to message #31199] Thu, 02 October 2003 05:53 Go to previous messageGo to next message
Eclipse User
Originally posted by: cipher8000.yahoo.com

Hi Ed,

Thanks the quick reply. Yes i was looking for a util class which already
works with XSD?

I thought i could use EMF model to generate xml but EMF works only inside
eclipse. I want something stand-alone.

If you have some ideas on implementing this, please let me know..i can go
ahead and implement it for XSD project.

-muruga

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:3F7B5A4C.F4733786@ca.ibm.com...
Muruga,

Generating XML instances would be a very cool stand-alone application for
the
XSD model, but we haven't done that yet. It's an interesting and somewhat
open-ended problem. Are you considering building one using XSD or are you
just
looking for one that already works?


Muruga Chinnananchi wrote:

> Hi,
>
> Is there any util classes to generate sample xml from an xsd file? i know
we
> can use EMF to generate sample xml but it works with only eclipse UI...i
am
> looking for a stand-alone library to generate sample xml.
>
> thanks
> -muruga
Re: generating sample xml from xsd [message #31268 is a reply to message #31232] Thu, 02 October 2003 09:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Muruga,

I'm not sure what you mean by "EMF works only inside Eclipse". EMF is layered
so that may of its parts, including models and even EMF.Edit, work standalone
without any other Eclipse jars on the classpath. The problem of generating
model instances from an Ecore model, is a very similar problem to generating
XML instances from an XML Schema model, though I think it's a significantly
simpler problem, since XML Schema is about 5-10 times more complicated than
Ecore (even though they have roughly the same expressive power).

I don't have a lot of detailed thoughts on how to proceed. For a given schema
you'd consider all the global element declarations,
XSDSchema.getElementDeclarations, as candidates for the root element of an
instance. Then given the type definition of the root element, which is either
simple or complex, you'd use that information to generate either simple
content, or attribute and element content based on the complex type. You'd
have to guard against infinite recursion and you'd have to analyze carefully
the particle structure of a complex type to ensure you create a valid instance.



Muruga Chinnananchi wrote:

> Hi Ed,
>
> Thanks the quick reply. Yes i was looking for a util class which already
> works with XSD?
>
> I thought i could use EMF model to generate xml but EMF works only inside
> eclipse. I want something stand-alone.
>
> If you have some ideas on implementing this, please let me know..i can go
> ahead and implement it for XSD project.
>
> -muruga
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F7B5A4C.F4733786@ca.ibm.com...
> Muruga,
>
> Generating XML instances would be a very cool stand-alone application for
> the
> XSD model, but we haven't done that yet. It's an interesting and somewhat
> open-ended problem. Are you considering building one using XSD or are you
> just
> looking for one that already works?
>
> Muruga Chinnananchi wrote:
>
> > Hi,
> >
> > Is there any util classes to generate sample xml from an xsd file? i know
> we
> > can use EMF to generate sample xml but it works with only eclipse UI...i
> am
> > looking for a stand-alone library to generate sample xml.
> >
> > thanks
> > -muruga
Re: generating sample xml from xsd [message #31377 is a reply to message #31268] Mon, 06 October 2003 11:26 Go to previous messageGo to next message
Eclipse User
Originally posted by: rob.tice.k-int.com

I have written a set of utility classes which generate an xml instance from
a schema using xsd. It x-references to find possible roots and it will
populate the instance from values within the relevant enumerations if
necessary. It resolves imports, redefines etc..

I have written it as a small part of an eductional metadata project that we
are working on in the UK. It is currently in testing and it will be a GPL
piece of code when it is released (as will the whole of the project, and
indeed as is all of our software). If this could be useful to the xsd
project even as a starting point just let me know and I will send the
relevant info to the list when it is tested.

Regards

Rob Tice

Technical Director

Knowledge Integration Ltd

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:3F7BEFED.11A1EBE0@ca.ibm.com...
> Muruga,
>
> I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
layered
> so that may of its parts, including models and even EMF.Edit, work
standalone
> without any other Eclipse jars on the classpath. The problem of
generating
> model instances from an Ecore model, is a very similar problem to
generating
> XML instances from an XML Schema model, though I think it's a
significantly
> simpler problem, since XML Schema is about 5-10 times more complicated
than
> Ecore (even though they have roughly the same expressive power).
>
> I don't have a lot of detailed thoughts on how to proceed. For a given
schema
> you'd consider all the global element declarations,
> XSDSchema.getElementDeclarations, as candidates for the root element of an
> instance. Then given the type definition of the root element, which is
either
> simple or complex, you'd use that information to generate either simple
> content, or attribute and element content based on the complex type.
You'd
> have to guard against infinite recursion and you'd have to analyze
carefully
> the particle structure of a complex type to ensure you create a valid
instance.
>
>
>
> Muruga Chinnananchi wrote:
>
> > Hi Ed,
> >
> > Thanks the quick reply. Yes i was looking for a util class which
already
> > works with XSD?
> >
> > I thought i could use EMF model to generate xml but EMF works only
inside
> > eclipse. I want something stand-alone.
> >
> > If you have some ideas on implementing this, please let me know..i can
go
> > ahead and implement it for XSD project.
> >
> > -muruga
> >
> > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > news:3F7B5A4C.F4733786@ca.ibm.com...
> > Muruga,
> >
> > Generating XML instances would be a very cool stand-alone application
for
> > the
> > XSD model, but we haven't done that yet. It's an interesting and
somewhat
> > open-ended problem. Are you considering building one using XSD or are
you
> > just
> > looking for one that already works?
> >
> > Muruga Chinnananchi wrote:
> >
> > > Hi,
> > >
> > > Is there any util classes to generate sample xml from an xsd file? i
know
> > we
> > > can use EMF to generate sample xml but it works with only eclipse
UI...i
> > am
> > > looking for a stand-alone library to generate sample xml.
> > >
> > > thanks
> > > -muruga
>
Re: generating sample xml from xsd [message #31433 is a reply to message #31377] Tue, 07 October 2003 10:18 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Rob,

This sounds interesting. I'd like to have a look when it's available.


Robert Tice wrote:

> I have written a set of utility classes which generate an xml instance from
> a schema using xsd. It x-references to find possible roots and it will
> populate the instance from values within the relevant enumerations if
> necessary. It resolves imports, redefines etc..
>
> I have written it as a small part of an eductional metadata project that we
> are working on in the UK. It is currently in testing and it will be a GPL
> piece of code when it is released (as will the whole of the project, and
> indeed as is all of our software). If this could be useful to the xsd
> project even as a starting point just let me know and I will send the
> relevant info to the list when it is tested.
>
> Regards
>
> Rob Tice
>
> Technical Director
>
> Knowledge Integration Ltd
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > Muruga,
> >
> > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> layered
> > so that may of its parts, including models and even EMF.Edit, work
> standalone
> > without any other Eclipse jars on the classpath. The problem of
> generating
> > model instances from an Ecore model, is a very similar problem to
> generating
> > XML instances from an XML Schema model, though I think it's a
> significantly
> > simpler problem, since XML Schema is about 5-10 times more complicated
> than
> > Ecore (even though they have roughly the same expressive power).
> >
> > I don't have a lot of detailed thoughts on how to proceed. For a given
> schema
> > you'd consider all the global element declarations,
> > XSDSchema.getElementDeclarations, as candidates for the root element of an
> > instance. Then given the type definition of the root element, which is
> either
> > simple or complex, you'd use that information to generate either simple
> > content, or attribute and element content based on the complex type.
> You'd
> > have to guard against infinite recursion and you'd have to analyze
> carefully
> > the particle structure of a complex type to ensure you create a valid
> instance.
> >
> >
> >
> > Muruga Chinnananchi wrote:
> >
> > > Hi Ed,
> > >
> > > Thanks the quick reply. Yes i was looking for a util class which
> already
> > > works with XSD?
> > >
> > > I thought i could use EMF model to generate xml but EMF works only
> inside
> > > eclipse. I want something stand-alone.
> > >
> > > If you have some ideas on implementing this, please let me know..i can
> go
> > > ahead and implement it for XSD project.
> > >
> > > -muruga
> > >
> > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > Muruga,
> > >
> > > Generating XML instances would be a very cool stand-alone application
> for
> > > the
> > > XSD model, but we haven't done that yet. It's an interesting and
> somewhat
> > > open-ended problem. Are you considering building one using XSD or are
> you
> > > just
> > > looking for one that already works?
> > >
> > > Muruga Chinnananchi wrote:
> > >
> > > > Hi,
> > > >
> > > > Is there any util classes to generate sample xml from an xsd file? i
> know
> > > we
> > > > can use EMF to generate sample xml but it works with only eclipse
> UI...i
> > > am
> > > > looking for a stand-alone library to generate sample xml.
> > > >
> > > > thanks
> > > > -muruga
> >
Re: generating sample xml from xsd [message #33740 is a reply to message #31433] Fri, 28 November 2003 08:41 Go to previous messageGo to next message
Eclipse User
Originally posted by: stefantura.poczta.onet.pl

Hi,

I also works on some sort of XSD validator (generator) for simlpe XML files
on my student project - so if you could send some info, I will be greateful.

Anyway which method do you use for XML to XSD validation ?

--
best regards
Stefan Turalski

Uzytkownik "Ed Merks" <merks@ca.ibm.com> napisal w wiadomosci
news:3F8292D9.622CAF02@ca.ibm.com...
> Rob,
>
> This sounds interesting. I'd like to have a look when it's available.
>
>
> Robert Tice wrote:
>
> > I have written a set of utility classes which generate an xml instance
from
> > a schema using xsd. It x-references to find possible roots and it will
> > populate the instance from values within the relevant enumerations if
> > necessary. It resolves imports, redefines etc..
> >
> > I have written it as a small part of an eductional metadata project that
we
> > are working on in the UK. It is currently in testing and it will be a
GPL
> > piece of code when it is released (as will the whole of the project, and
> > indeed as is all of our software). If this could be useful to the xsd
> > project even as a starting point just let me know and I will send the
> > relevant info to the list when it is tested.
> >
> > Regards
> >
> > Rob Tice
> >
> > Technical Director
> >
> > Knowledge Integration Ltd
> >
> > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > > Muruga,
> > >
> > > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> > layered
> > > so that may of its parts, including models and even EMF.Edit, work
> > standalone
> > > without any other Eclipse jars on the classpath. The problem of
> > generating
> > > model instances from an Ecore model, is a very similar problem to
> > generating
> > > XML instances from an XML Schema model, though I think it's a
> > significantly
> > > simpler problem, since XML Schema is about 5-10 times more complicated
> > than
> > > Ecore (even though they have roughly the same expressive power).
> > >
> > > I don't have a lot of detailed thoughts on how to proceed. For a
given
> > schema
> > > you'd consider all the global element declarations,
> > > XSDSchema.getElementDeclarations, as candidates for the root element
of an
> > > instance. Then given the type definition of the root element, which
is
> > either
> > > simple or complex, you'd use that information to generate either
simple
> > > content, or attribute and element content based on the complex type.
> > You'd
> > > have to guard against infinite recursion and you'd have to analyze
> > carefully
> > > the particle structure of a complex type to ensure you create a valid
> > instance.
> > >
> > >
> > >
> > > Muruga Chinnananchi wrote:
> > >
> > > > Hi Ed,
> > > >
> > > > Thanks the quick reply. Yes i was looking for a util class which
> > already
> > > > works with XSD?
> > > >
> > > > I thought i could use EMF model to generate xml but EMF works only
> > inside
> > > > eclipse. I want something stand-alone.
> > > >
> > > > If you have some ideas on implementing this, please let me know..i
can
> > go
> > > > ahead and implement it for XSD project.
> > > >
> > > > -muruga
> > > >
> > > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > > Muruga,
> > > >
> > > > Generating XML instances would be a very cool stand-alone
application
> > for
> > > > the
> > > > XSD model, but we haven't done that yet. It's an interesting and
> > somewhat
> > > > open-ended problem. Are you considering building one using XSD or
are
> > you
> > > > just
> > > > looking for one that already works?
> > > >
> > > > Muruga Chinnananchi wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Is there any util classes to generate sample xml from an xsd file?
i
> > know
> > > > we
> > > > > can use EMF to generate sample xml but it works with only eclipse
> > UI...i
> > > > am
> > > > > looking for a stand-alone library to generate sample xml.
> > > > >
> > > > > thanks
> > > > > -muruga
> > >
>
Re: generating sample xml from xsd [message #33774 is a reply to message #33740] Fri, 28 November 2003 10:54 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

Stefan,

I don't have any information on generating XML from XSD. As for validation,
there's XSDSimpleTypeDefinition.assess which can be used to validate a simple
value against a simple type, but there isn't such a method for validating a
complex value against a complex type because there's no support for that (yet).


Stfean Turalski wrote:

> Hi,
>
> I also works on some sort of XSD validator (generator) for simlpe XML files
> on my student project - so if you could send some info, I will be greateful.
>
> Anyway which method do you use for XML to XSD validation ?
>
> --
> best regards
> Stefan Turalski
>
> Uzytkownik "Ed Merks" <merks@ca.ibm.com> napisal w wiadomosci
> news:3F8292D9.622CAF02@ca.ibm.com...
> > Rob,
> >
> > This sounds interesting. I'd like to have a look when it's available.
> >
> >
> > Robert Tice wrote:
> >
> > > I have written a set of utility classes which generate an xml instance
> from
> > > a schema using xsd. It x-references to find possible roots and it will
> > > populate the instance from values within the relevant enumerations if
> > > necessary. It resolves imports, redefines etc..
> > >
> > > I have written it as a small part of an eductional metadata project that
> we
> > > are working on in the UK. It is currently in testing and it will be a
> GPL
> > > piece of code when it is released (as will the whole of the project, and
> > > indeed as is all of our software). If this could be useful to the xsd
> > > project even as a starting point just let me know and I will send the
> > > relevant info to the list when it is tested.
> > >
> > > Regards
> > >
> > > Rob Tice
> > >
> > > Technical Director
> > >
> > > Knowledge Integration Ltd
> > >
> > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > > > Muruga,
> > > >
> > > > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> > > layered
> > > > so that may of its parts, including models and even EMF.Edit, work
> > > standalone
> > > > without any other Eclipse jars on the classpath. The problem of
> > > generating
> > > > model instances from an Ecore model, is a very similar problem to
> > > generating
> > > > XML instances from an XML Schema model, though I think it's a
> > > significantly
> > > > simpler problem, since XML Schema is about 5-10 times more complicated
> > > than
> > > > Ecore (even though they have roughly the same expressive power).
> > > >
> > > > I don't have a lot of detailed thoughts on how to proceed. For a
> given
> > > schema
> > > > you'd consider all the global element declarations,
> > > > XSDSchema.getElementDeclarations, as candidates for the root element
> of an
> > > > instance. Then given the type definition of the root element, which
> is
> > > either
> > > > simple or complex, you'd use that information to generate either
> simple
> > > > content, or attribute and element content based on the complex type.
> > > You'd
> > > > have to guard against infinite recursion and you'd have to analyze
> > > carefully
> > > > the particle structure of a complex type to ensure you create a valid
> > > instance.
> > > >
> > > >
> > > >
> > > > Muruga Chinnananchi wrote:
> > > >
> > > > > Hi Ed,
> > > > >
> > > > > Thanks the quick reply. Yes i was looking for a util class which
> > > already
> > > > > works with XSD?
> > > > >
> > > > > I thought i could use EMF model to generate xml but EMF works only
> > > inside
> > > > > eclipse. I want something stand-alone.
> > > > >
> > > > > If you have some ideas on implementing this, please let me know..i
> can
> > > go
> > > > > ahead and implement it for XSD project.
> > > > >
> > > > > -muruga
> > > > >
> > > > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > > > Muruga,
> > > > >
> > > > > Generating XML instances would be a very cool stand-alone
> application
> > > for
> > > > > the
> > > > > XSD model, but we haven't done that yet. It's an interesting and
> > > somewhat
> > > > > open-ended problem. Are you considering building one using XSD or
> are
> > > you
> > > > > just
> > > > > looking for one that already works?
> > > > >
> > > > > Muruga Chinnananchi wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is there any util classes to generate sample xml from an xsd file?
> i
> > > know
> > > > > we
> > > > > > can use EMF to generate sample xml but it works with only eclipse
> > > UI...i
> > > > > am
> > > > > > looking for a stand-alone library to generate sample xml.
> > > > > >
> > > > > > thanks
> > > > > > -muruga
> > > >
> >
Re: generating sample xml from xsd [message #579315 is a reply to message #31164] Wed, 01 October 2003 22:50 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Muruga,

Generating XML instances would be a very cool stand-alone application for the
XSD model, but we haven't done that yet. It's an interesting and somewhat
open-ended problem. Are you considering building one using XSD or are you just
looking for one that already works?


Muruga Chinnananchi wrote:

> Hi,
>
> Is there any util classes to generate sample xml from an xsd file? i know we
> can use EMF to generate sample xml but it works with only eclipse UI...i am
> looking for a stand-alone library to generate sample xml.
>
> thanks
> -muruga
Re: generating sample xml from xsd [message #579351 is a reply to message #31199] Thu, 02 October 2003 05:53 Go to previous message
Eclipse User
Originally posted by: cipher8000.yahoo.com

Hi Ed,

Thanks the quick reply. Yes i was looking for a util class which already
works with XSD?

I thought i could use EMF model to generate xml but EMF works only inside
eclipse. I want something stand-alone.

If you have some ideas on implementing this, please let me know..i can go
ahead and implement it for XSD project.

-muruga

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:3F7B5A4C.F4733786@ca.ibm.com...
Muruga,

Generating XML instances would be a very cool stand-alone application for
the
XSD model, but we haven't done that yet. It's an interesting and somewhat
open-ended problem. Are you considering building one using XSD or are you
just
looking for one that already works?


Muruga Chinnananchi wrote:

> Hi,
>
> Is there any util classes to generate sample xml from an xsd file? i know
we
> can use EMF to generate sample xml but it works with only eclipse UI...i
am
> looking for a stand-alone library to generate sample xml.
>
> thanks
> -muruga
Re: generating sample xml from xsd [message #579386 is a reply to message #31232] Thu, 02 October 2003 09:29 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Muruga,

I'm not sure what you mean by "EMF works only inside Eclipse". EMF is layered
so that may of its parts, including models and even EMF.Edit, work standalone
without any other Eclipse jars on the classpath. The problem of generating
model instances from an Ecore model, is a very similar problem to generating
XML instances from an XML Schema model, though I think it's a significantly
simpler problem, since XML Schema is about 5-10 times more complicated than
Ecore (even though they have roughly the same expressive power).

I don't have a lot of detailed thoughts on how to proceed. For a given schema
you'd consider all the global element declarations,
XSDSchema.getElementDeclarations, as candidates for the root element of an
instance. Then given the type definition of the root element, which is either
simple or complex, you'd use that information to generate either simple
content, or attribute and element content based on the complex type. You'd
have to guard against infinite recursion and you'd have to analyze carefully
the particle structure of a complex type to ensure you create a valid instance.



Muruga Chinnananchi wrote:

> Hi Ed,
>
> Thanks the quick reply. Yes i was looking for a util class which already
> works with XSD?
>
> I thought i could use EMF model to generate xml but EMF works only inside
> eclipse. I want something stand-alone.
>
> If you have some ideas on implementing this, please let me know..i can go
> ahead and implement it for XSD project.
>
> -muruga
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F7B5A4C.F4733786@ca.ibm.com...
> Muruga,
>
> Generating XML instances would be a very cool stand-alone application for
> the
> XSD model, but we haven't done that yet. It's an interesting and somewhat
> open-ended problem. Are you considering building one using XSD or are you
> just
> looking for one that already works?
>
> Muruga Chinnananchi wrote:
>
> > Hi,
> >
> > Is there any util classes to generate sample xml from an xsd file? i know
> we
> > can use EMF to generate sample xml but it works with only eclipse UI...i
> am
> > looking for a stand-alone library to generate sample xml.
> >
> > thanks
> > -muruga
Re: generating sample xml from xsd [message #579511 is a reply to message #31268] Mon, 06 October 2003 11:26 Go to previous message
Eclipse User
Originally posted by: rob.tice.k-int.com

I have written a set of utility classes which generate an xml instance from
a schema using xsd. It x-references to find possible roots and it will
populate the instance from values within the relevant enumerations if
necessary. It resolves imports, redefines etc..

I have written it as a small part of an eductional metadata project that we
are working on in the UK. It is currently in testing and it will be a GPL
piece of code when it is released (as will the whole of the project, and
indeed as is all of our software). If this could be useful to the xsd
project even as a starting point just let me know and I will send the
relevant info to the list when it is tested.

Regards

Rob Tice

Technical Director

Knowledge Integration Ltd

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:3F7BEFED.11A1EBE0@ca.ibm.com...
> Muruga,
>
> I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
layered
> so that may of its parts, including models and even EMF.Edit, work
standalone
> without any other Eclipse jars on the classpath. The problem of
generating
> model instances from an Ecore model, is a very similar problem to
generating
> XML instances from an XML Schema model, though I think it's a
significantly
> simpler problem, since XML Schema is about 5-10 times more complicated
than
> Ecore (even though they have roughly the same expressive power).
>
> I don't have a lot of detailed thoughts on how to proceed. For a given
schema
> you'd consider all the global element declarations,
> XSDSchema.getElementDeclarations, as candidates for the root element of an
> instance. Then given the type definition of the root element, which is
either
> simple or complex, you'd use that information to generate either simple
> content, or attribute and element content based on the complex type.
You'd
> have to guard against infinite recursion and you'd have to analyze
carefully
> the particle structure of a complex type to ensure you create a valid
instance.
>
>
>
> Muruga Chinnananchi wrote:
>
> > Hi Ed,
> >
> > Thanks the quick reply. Yes i was looking for a util class which
already
> > works with XSD?
> >
> > I thought i could use EMF model to generate xml but EMF works only
inside
> > eclipse. I want something stand-alone.
> >
> > If you have some ideas on implementing this, please let me know..i can
go
> > ahead and implement it for XSD project.
> >
> > -muruga
> >
> > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > news:3F7B5A4C.F4733786@ca.ibm.com...
> > Muruga,
> >
> > Generating XML instances would be a very cool stand-alone application
for
> > the
> > XSD model, but we haven't done that yet. It's an interesting and
somewhat
> > open-ended problem. Are you considering building one using XSD or are
you
> > just
> > looking for one that already works?
> >
> > Muruga Chinnananchi wrote:
> >
> > > Hi,
> > >
> > > Is there any util classes to generate sample xml from an xsd file? i
know
> > we
> > > can use EMF to generate sample xml but it works with only eclipse
UI...i
> > am
> > > looking for a stand-alone library to generate sample xml.
> > >
> > > thanks
> > > -muruga
>
Re: generating sample xml from xsd [message #579546 is a reply to message #31377] Tue, 07 October 2003 10:18 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Rob,

This sounds interesting. I'd like to have a look when it's available.


Robert Tice wrote:

> I have written a set of utility classes which generate an xml instance from
> a schema using xsd. It x-references to find possible roots and it will
> populate the instance from values within the relevant enumerations if
> necessary. It resolves imports, redefines etc..
>
> I have written it as a small part of an eductional metadata project that we
> are working on in the UK. It is currently in testing and it will be a GPL
> piece of code when it is released (as will the whole of the project, and
> indeed as is all of our software). If this could be useful to the xsd
> project even as a starting point just let me know and I will send the
> relevant info to the list when it is tested.
>
> Regards
>
> Rob Tice
>
> Technical Director
>
> Knowledge Integration Ltd
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > Muruga,
> >
> > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> layered
> > so that may of its parts, including models and even EMF.Edit, work
> standalone
> > without any other Eclipse jars on the classpath. The problem of
> generating
> > model instances from an Ecore model, is a very similar problem to
> generating
> > XML instances from an XML Schema model, though I think it's a
> significantly
> > simpler problem, since XML Schema is about 5-10 times more complicated
> than
> > Ecore (even though they have roughly the same expressive power).
> >
> > I don't have a lot of detailed thoughts on how to proceed. For a given
> schema
> > you'd consider all the global element declarations,
> > XSDSchema.getElementDeclarations, as candidates for the root element of an
> > instance. Then given the type definition of the root element, which is
> either
> > simple or complex, you'd use that information to generate either simple
> > content, or attribute and element content based on the complex type.
> You'd
> > have to guard against infinite recursion and you'd have to analyze
> carefully
> > the particle structure of a complex type to ensure you create a valid
> instance.
> >
> >
> >
> > Muruga Chinnananchi wrote:
> >
> > > Hi Ed,
> > >
> > > Thanks the quick reply. Yes i was looking for a util class which
> already
> > > works with XSD?
> > >
> > > I thought i could use EMF model to generate xml but EMF works only
> inside
> > > eclipse. I want something stand-alone.
> > >
> > > If you have some ideas on implementing this, please let me know..i can
> go
> > > ahead and implement it for XSD project.
> > >
> > > -muruga
> > >
> > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > Muruga,
> > >
> > > Generating XML instances would be a very cool stand-alone application
> for
> > > the
> > > XSD model, but we haven't done that yet. It's an interesting and
> somewhat
> > > open-ended problem. Are you considering building one using XSD or are
> you
> > > just
> > > looking for one that already works?
> > >
> > > Muruga Chinnananchi wrote:
> > >
> > > > Hi,
> > > >
> > > > Is there any util classes to generate sample xml from an xsd file? i
> know
> > > we
> > > > can use EMF to generate sample xml but it works with only eclipse
> UI...i
> > > am
> > > > looking for a stand-alone library to generate sample xml.
> > > >
> > > > thanks
> > > > -muruga
> >
Re: generating sample xml from xsd [message #581206 is a reply to message #31433] Fri, 28 November 2003 08:41 Go to previous message
Eclipse User
Originally posted by: stefantura.poczta.onet.pl

Hi,

I also works on some sort of XSD validator (generator) for simlpe XML files
on my student project - so if you could send some info, I will be greateful.

Anyway which method do you use for XML to XSD validation ?

--
best regards
Stefan Turalski

Uzytkownik "Ed Merks" <merks@ca.ibm.com> napisal w wiadomosci
news:3F8292D9.622CAF02@ca.ibm.com...
> Rob,
>
> This sounds interesting. I'd like to have a look when it's available.
>
>
> Robert Tice wrote:
>
> > I have written a set of utility classes which generate an xml instance
from
> > a schema using xsd. It x-references to find possible roots and it will
> > populate the instance from values within the relevant enumerations if
> > necessary. It resolves imports, redefines etc..
> >
> > I have written it as a small part of an eductional metadata project that
we
> > are working on in the UK. It is currently in testing and it will be a
GPL
> > piece of code when it is released (as will the whole of the project, and
> > indeed as is all of our software). If this could be useful to the xsd
> > project even as a starting point just let me know and I will send the
> > relevant info to the list when it is tested.
> >
> > Regards
> >
> > Rob Tice
> >
> > Technical Director
> >
> > Knowledge Integration Ltd
> >
> > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > > Muruga,
> > >
> > > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> > layered
> > > so that may of its parts, including models and even EMF.Edit, work
> > standalone
> > > without any other Eclipse jars on the classpath. The problem of
> > generating
> > > model instances from an Ecore model, is a very similar problem to
> > generating
> > > XML instances from an XML Schema model, though I think it's a
> > significantly
> > > simpler problem, since XML Schema is about 5-10 times more complicated
> > than
> > > Ecore (even though they have roughly the same expressive power).
> > >
> > > I don't have a lot of detailed thoughts on how to proceed. For a
given
> > schema
> > > you'd consider all the global element declarations,
> > > XSDSchema.getElementDeclarations, as candidates for the root element
of an
> > > instance. Then given the type definition of the root element, which
is
> > either
> > > simple or complex, you'd use that information to generate either
simple
> > > content, or attribute and element content based on the complex type.
> > You'd
> > > have to guard against infinite recursion and you'd have to analyze
> > carefully
> > > the particle structure of a complex type to ensure you create a valid
> > instance.
> > >
> > >
> > >
> > > Muruga Chinnananchi wrote:
> > >
> > > > Hi Ed,
> > > >
> > > > Thanks the quick reply. Yes i was looking for a util class which
> > already
> > > > works with XSD?
> > > >
> > > > I thought i could use EMF model to generate xml but EMF works only
> > inside
> > > > eclipse. I want something stand-alone.
> > > >
> > > > If you have some ideas on implementing this, please let me know..i
can
> > go
> > > > ahead and implement it for XSD project.
> > > >
> > > > -muruga
> > > >
> > > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > > Muruga,
> > > >
> > > > Generating XML instances would be a very cool stand-alone
application
> > for
> > > > the
> > > > XSD model, but we haven't done that yet. It's an interesting and
> > somewhat
> > > > open-ended problem. Are you considering building one using XSD or
are
> > you
> > > > just
> > > > looking for one that already works?
> > > >
> > > > Muruga Chinnananchi wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Is there any util classes to generate sample xml from an xsd file?
i
> > know
> > > > we
> > > > > can use EMF to generate sample xml but it works with only eclipse
> > UI...i
> > > > am
> > > > > looking for a stand-alone library to generate sample xml.
> > > > >
> > > > > thanks
> > > > > -muruga
> > >
>
Re: generating sample xml from xsd [message #581222 is a reply to message #33740] Fri, 28 November 2003 10:54 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Stefan,

I don't have any information on generating XML from XSD. As for validation,
there's XSDSimpleTypeDefinition.assess which can be used to validate a simple
value against a simple type, but there isn't such a method for validating a
complex value against a complex type because there's no support for that (yet).


Stfean Turalski wrote:

> Hi,
>
> I also works on some sort of XSD validator (generator) for simlpe XML files
> on my student project - so if you could send some info, I will be greateful.
>
> Anyway which method do you use for XML to XSD validation ?
>
> --
> best regards
> Stefan Turalski
>
> Uzytkownik "Ed Merks" <merks@ca.ibm.com> napisal w wiadomosci
> news:3F8292D9.622CAF02@ca.ibm.com...
> > Rob,
> >
> > This sounds interesting. I'd like to have a look when it's available.
> >
> >
> > Robert Tice wrote:
> >
> > > I have written a set of utility classes which generate an xml instance
> from
> > > a schema using xsd. It x-references to find possible roots and it will
> > > populate the instance from values within the relevant enumerations if
> > > necessary. It resolves imports, redefines etc..
> > >
> > > I have written it as a small part of an eductional metadata project that
> we
> > > are working on in the UK. It is currently in testing and it will be a
> GPL
> > > piece of code when it is released (as will the whole of the project, and
> > > indeed as is all of our software). If this could be useful to the xsd
> > > project even as a starting point just let me know and I will send the
> > > relevant info to the list when it is tested.
> > >
> > > Regards
> > >
> > > Rob Tice
> > >
> > > Technical Director
> > >
> > > Knowledge Integration Ltd
> > >
> > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > news:3F7BEFED.11A1EBE0@ca.ibm.com...
> > > > Muruga,
> > > >
> > > > I'm not sure what you mean by "EMF works only inside Eclipse". EMF is
> > > layered
> > > > so that may of its parts, including models and even EMF.Edit, work
> > > standalone
> > > > without any other Eclipse jars on the classpath. The problem of
> > > generating
> > > > model instances from an Ecore model, is a very similar problem to
> > > generating
> > > > XML instances from an XML Schema model, though I think it's a
> > > significantly
> > > > simpler problem, since XML Schema is about 5-10 times more complicated
> > > than
> > > > Ecore (even though they have roughly the same expressive power).
> > > >
> > > > I don't have a lot of detailed thoughts on how to proceed. For a
> given
> > > schema
> > > > you'd consider all the global element declarations,
> > > > XSDSchema.getElementDeclarations, as candidates for the root element
> of an
> > > > instance. Then given the type definition of the root element, which
> is
> > > either
> > > > simple or complex, you'd use that information to generate either
> simple
> > > > content, or attribute and element content based on the complex type.
> > > You'd
> > > > have to guard against infinite recursion and you'd have to analyze
> > > carefully
> > > > the particle structure of a complex type to ensure you create a valid
> > > instance.
> > > >
> > > >
> > > >
> > > > Muruga Chinnananchi wrote:
> > > >
> > > > > Hi Ed,
> > > > >
> > > > > Thanks the quick reply. Yes i was looking for a util class which
> > > already
> > > > > works with XSD?
> > > > >
> > > > > I thought i could use EMF model to generate xml but EMF works only
> > > inside
> > > > > eclipse. I want something stand-alone.
> > > > >
> > > > > If you have some ideas on implementing this, please let me know..i
> can
> > > go
> > > > > ahead and implement it for XSD project.
> > > > >
> > > > > -muruga
> > > > >
> > > > > "Ed Merks" <merks@ca.ibm.com> wrote in message
> > > > > news:3F7B5A4C.F4733786@ca.ibm.com...
> > > > > Muruga,
> > > > >
> > > > > Generating XML instances would be a very cool stand-alone
> application
> > > for
> > > > > the
> > > > > XSD model, but we haven't done that yet. It's an interesting and
> > > somewhat
> > > > > open-ended problem. Are you considering building one using XSD or
> are
> > > you
> > > > > just
> > > > > looking for one that already works?
> > > > >
> > > > > Muruga Chinnananchi wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Is there any util classes to generate sample xml from an xsd file?
> i
> > > know
> > > > > we
> > > > > > can use EMF to generate sample xml but it works with only eclipse
> > > UI...i
> > > > > am
> > > > > > looking for a stand-alone library to generate sample xml.
> > > > > >
> > > > > > thanks
> > > > > > -muruga
> > > >
> >
Previous Topic:Bug in validation?
Next Topic:test msg
Goto Forum:
  


Current Time: Tue Oct 21 08:57:13 GMT 2014

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

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