Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Problem with EMF generation from 2 XSDs
Problem with EMF generation from 2 XSDs [message #77818] Mon, 08 June 2009 17:07 Go to next message
Rodrigo Garcia is currently offline Rodrigo Garcia
Messages: 4
Registered: July 2009
Junior Member
Hi,

I'm trying to generate the code representations of the following XSDs:

http://www.facturae.es/NR/rdonlyres/FA3C95E7-D50C-42CB-9E38- B97BCFDB3CC4/0/1Facturae30.xsd

http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd

As you can see, the first one references the second through this element:

<xs:element ref="ds:Signature" minOccurs="0">
</xs:element>

After generating the code, when I try to test it using a sample XML I
receive a NullPointerException trying to parse that particular element.

I also try to use the editor that EMF generates to create a new XML
document for the first XSD, but although the "Signature" element is listed
as an available child in the corresponding drop-down list, the option is
grayed, so I can't select it.

I think that the problem may be in the fact that the referenced element is
from a different namespace. However, the second edition of EMF book, in
chapter 9.5.8 says that this option should be possible, so I'm puzzled.

By the way, the sample XML file is this one:

http://www.facturae.es/NR/rdonlyres/DB04EF8B-301E-459B-8852- 6193579E4FEF/0/factura2_ejemplo30.xml

Thanks in advance,

Rodrigo García
Re: Problem with EMF generation from 2 XSDs [message #77835 is a reply to message #77818] Mon, 08 June 2009 18:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26130
Registered: July 2009
Senior Member
Rodrigo,

It looks like the "#" in the target namespace is getting EMF upset;
that's normally the separator between a base URI and the fragment. If
you change the Facturae's GenPackage's "Initialize by Loading" property
to false, the null pointer problem goes away.


Rodrigo Garcia wrote:
> Hi,
>
> I'm trying to generate the code representations of the following XSDs:
>
> http://www.facturae.es/NR/rdonlyres/FA3C95E7-D50C-42CB-9E38- B97BCFDB3CC4/0/1Facturae30.xsd
>
>
> http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
>
> As you can see, the first one references the second through this element:
>
> <xs:element ref="ds:Signature" minOccurs="0"> </xs:element>
>
> After generating the code, when I try to test it using a sample XML I
> receive a NullPointerException trying to parse that particular element.
>
> I also try to use the editor that EMF generates to create a new XML
> document for the first XSD, but although the "Signature" element is
> listed as an available child in the corresponding drop-down list, the
> option is grayed, so I can't select it.
>
> I think that the problem may be in the fact that the referenced
> element is from a different namespace. However, the second edition of
> EMF book, in chapter 9.5.8 says that this option should be possible,
> so I'm puzzled.
>
> By the way, the sample XML file is this one:
>
> http://www.facturae.es/NR/rdonlyres/DB04EF8B-301E-459B-8852- 6193579E4FEF/0/factura2_ejemplo30.xml
>
>
> Thanks in advance,
>
> Rodrigo García
>
Re: Problem with EMF generation from 2 XSDs [message #77850 is a reply to message #77835] Tue, 09 June 2009 09:29 Go to previous message
Rodrigo Garcia is currently offline Rodrigo Garcia
Messages: 4
Registered: July 2009
Junior Member
Hi,

Thanks for your quick response. My problem is now mostly solved. The
GenPackage property change did the trick.

Best regards,

Rodrigo García
Re: Problem with EMF generation from 2 XSDs [message #604230 is a reply to message #77818] Mon, 08 June 2009 18:34 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26130
Registered: July 2009
Senior Member
Rodrigo,

It looks like the "#" in the target namespace is getting EMF upset;
that's normally the separator between a base URI and the fragment. If
you change the Facturae's GenPackage's "Initialize by Loading" property
to false, the null pointer problem goes away.


Rodrigo Garcia wrote:
> Hi,
>
> I'm trying to generate the code representations of the following XSDs:
>
> http://www.facturae.es/NR/rdonlyres/FA3C95E7-D50C-42CB-9E38- B97BCFDB3CC4/0/1Facturae30.xsd
>
>
> http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
>
> As you can see, the first one references the second through this element:
>
> <xs:element ref="ds:Signature" minOccurs="0"> </xs:element>
>
> After generating the code, when I try to test it using a sample XML I
> receive a NullPointerException trying to parse that particular element.
>
> I also try to use the editor that EMF generates to create a new XML
> document for the first XSD, but although the "Signature" element is
> listed as an available child in the corresponding drop-down list, the
> option is grayed, so I can't select it.
>
> I think that the problem may be in the fact that the referenced
> element is from a different namespace. However, the second edition of
> EMF book, in chapter 9.5.8 says that this option should be possible,
> so I'm puzzled.
>
> By the way, the sample XML file is this one:
>
> http://www.facturae.es/NR/rdonlyres/DB04EF8B-301E-459B-8852- 6193579E4FEF/0/factura2_ejemplo30.xml
>
>
> Thanks in advance,
>
> Rodrigo García
>
Re: Problem with EMF generation from 2 XSDs [message #604234 is a reply to message #77835] Tue, 09 June 2009 09:29 Go to previous message
Rodrigo Garcia is currently offline Rodrigo Garcia
Messages: 4
Registered: July 2009
Junior Member
Hi,

Thanks for your quick response. My problem is now mostly solved. The
GenPackage property change did the trick.

Best regards,

Rodrigo García
Previous Topic:Problem with EMF generation from 2 XSDs
Next Topic:Defining mulitple persistency for EMF Model from one xsd
Goto Forum:
  


Current Time: Wed Oct 22 00:18:40 GMT 2014

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

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