You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Monica Granbois <mg...@abebooks.com> on 2004/06/16 01:53:55 UTC

Parsing question

Hi,

 

I have two schemas where one includes another.  Listingbookstored.xsd defines
a bunch of elements, and Listingbook.xsd includes that schema plus defines
some addition elements.  I have an xml document ("original.xml") that is
defined by the Listingbookstored.xsd schema. I now want to generate an xml
file using the Listingbook.xsd schema. I want to use the data that is in the
original.xml file plus populate some of the addition elements.  Is there a
way I can use the original.xml file to set the ListingBookDocument so that I
don't have to manually set the fields?

 

 

I tried doing something like the following but got an exception:

 

File myFile = new File( "original.xml" );

ListingBookDocument myXmlDoc = ListingBookDocument.Factory.parse( myFile );

 

The error:

org.apache.xmlbeans.XmlException: Element
ListingBookStored@http://www.abebooks.com/XMLSchema is not a valid
ListingBook@http://www.abebooks.com/XMLSchema document or a valid
substitution.

 

Thank you,

 

Monica

 

 

 


Re: Parsing question

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Can you post a little more of your code. from the
looks of it ( the error message). It appears that the
schema(ListingBookStored) was not compiled to create
the right interfaces/classes.
When compiling the schema it is possible to use
multiple schema during parse.

With Regards
Dutta:)


--- Monica Granbois <mg...@abebooks.com> wrote:
> Hi,
> 
>  
> 
> I have two schemas where one includes another. 
> Listingbookstored.xsd defines
> a bunch of elements, and Listingbook.xsd includes
> that schema plus defines
> some addition elements.  I have an xml document
> ("original.xml") that is
> defined by the Listingbookstored.xsd schema. I now
> want to generate an xml
> file using the Listingbook.xsd schema. I want to use
> the data that is in the
> original.xml file plus populate some of the addition
> elements.  Is there a
> way I can use the original.xml file to set the
> ListingBookDocument so that I
> don't have to manually set the fields?
> 
>  
> 
>  
> 
> I tried doing something like the following but got
> an exception:
> 
>  
> 
> File myFile = new File( "original.xml" );
> 
> ListingBookDocument myXmlDoc =
> ListingBookDocument.Factory.parse( myFile );
> 
>  
> 
> The error:
> 
> org.apache.xmlbeans.XmlException: Element
> ListingBookStored@http://www.abebooks.com/XMLSchema
> is not a valid
> ListingBook@http://www.abebooks.com/XMLSchema
> document or a valid
> substitution.
> 
>  
> 
> Thank you,
> 
>  
> 
> Monica
> 
>  
> 
>  
> 
>  
> 
> 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Parsing question

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Can you post a little more of your code. from the
looks of it ( the error message). It appears that the
schema(ListingBookStored) was not compiled to create
the right interfaces/classes.
When compiling the schema it is possible to use
multiple schema during parse.

With Regards
Dutta:)


--- Monica Granbois <mg...@abebooks.com> wrote:
> Hi,
> 
>  
> 
> I have two schemas where one includes another. 
> Listingbookstored.xsd defines
> a bunch of elements, and Listingbook.xsd includes
> that schema plus defines
> some addition elements.  I have an xml document
> ("original.xml") that is
> defined by the Listingbookstored.xsd schema. I now
> want to generate an xml
> file using the Listingbook.xsd schema. I want to use
> the data that is in the
> original.xml file plus populate some of the addition
> elements.  Is there a
> way I can use the original.xml file to set the
> ListingBookDocument so that I
> don't have to manually set the fields?
> 
>  
> 
>  
> 
> I tried doing something like the following but got
> an exception:
> 
>  
> 
> File myFile = new File( "original.xml" );
> 
> ListingBookDocument myXmlDoc =
> ListingBookDocument.Factory.parse( myFile );
> 
>  
> 
> The error:
> 
> org.apache.xmlbeans.XmlException: Element
> ListingBookStored@http://www.abebooks.com/XMLSchema
> is not a valid
> ListingBook@http://www.abebooks.com/XMLSchema
> document or a valid
> substitution.
> 
>  
> 
> Thank you,
> 
>  
> 
> Monica
> 
>  
> 
>  
> 
>  
> 
> 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/