You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Andre de Souza <ha...@bmi.osu.edu> on 2008/07/15 17:22:40 UTC

XMLBeans regarding valid XML file as invalid?


   Hi all,


   I used scomp to generate a parser for an XML file which root element 
is expected to be "WorkflowManagerInstanceDescriptor". The input file 
for scomp is the attached "WorkflowManager.xsd" file.
   I created an XML file (UnsecureWorkflow1.xml) and validated it 
against the schema using both Eclipse and Oxygen. For that reason, I 
believe the XML file is valid.
   However, when parsing it using the generated XMLBeans parser, I can't 
retrieve the information. Executing the attached java class gives an 
error message that claims the XML file isn't valid. So, have scomp not 
generated the parser appropriately or is one of my files invalid?




error: cvc-complex-type.2.4a: Expected element 
'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' 
instead of 
'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' 
here
error: cvc-complex-type.2.4c: Expected element 
'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' 
before the end of the content









Re: XMLBeans regarding valid XML file as invalid?

Posted by Andre de Souza <ha...@bmi.osu.edu>.

    It works! Using the Document instead of the Type does the trick. 
Thank you everyoby.

   Andre de Souza



Jacob Danner wrote:
> Its because your code is using the Type instead of the Document.
> If you use WorkflowManagerInstanceDescriptorDocument in your code
> instead these errors should go away.
> You can read a little more about why this is so here,
> http://xmlbeans.apache.org/docs/2.0.0/guide/conJavaTypesGeneratedFromUserDerived.html
> HTH,
> -jacobd
> 
> On Tue, Jul 15, 2008 at 8:22 AM, Andre de Souza <ha...@bmi.osu.edu> wrote:
>>
>>  Hi all,
>>
>>
>>  I used scomp to generate a parser for an XML file which root element is
>> expected to be "WorkflowManagerInstanceDescriptor". The input file for scomp
>> is the attached "WorkflowManager.xsd" file.
>>  I created an XML file (UnsecureWorkflow1.xml) and validated it against the
>> schema using both Eclipse and Oxygen. For that reason, I believe the XML
>> file is valid.
>>  However, when parsing it using the generated XMLBeans parser, I can't
>> retrieve the information. Executing the attached java class gives an error
>> message that claims the XML file isn't valid. So, have scomp not generated
>> the parser appropriately or is one of my files invalid?
>>
>>
>>
>>
>> error: cvc-complex-type.2.4a: Expected element
>> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
>> instead of
>> 'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
>> here
>> error: cvc-complex-type.2.4c: Expected element
>> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
>> before the end of the content
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: XMLBeans regarding valid XML file as invalid?

Posted by Jacob Danner <ja...@gmail.com>.
Its because your code is using the Type instead of the Document.
If you use WorkflowManagerInstanceDescriptorDocument in your code
instead these errors should go away.
You can read a little more about why this is so here,
http://xmlbeans.apache.org/docs/2.0.0/guide/conJavaTypesGeneratedFromUserDerived.html
HTH,
-jacobd

On Tue, Jul 15, 2008 at 8:22 AM, Andre de Souza <ha...@bmi.osu.edu> wrote:
>
>
>  Hi all,
>
>
>  I used scomp to generate a parser for an XML file which root element is
> expected to be "WorkflowManagerInstanceDescriptor". The input file for scomp
> is the attached "WorkflowManager.xsd" file.
>  I created an XML file (UnsecureWorkflow1.xml) and validated it against the
> schema using both Eclipse and Oxygen. For that reason, I believe the XML
> file is valid.
>  However, when parsing it using the generated XMLBeans parser, I can't
> retrieve the information. Executing the attached java class gives an error
> message that claims the XML file isn't valid. So, have scomp not generated
> the parser appropriately or is one of my files invalid?
>
>
>
>
> error: cvc-complex-type.2.4a: Expected element
> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
> instead of
> 'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
> here
> error: cvc-complex-type.2.4c: Expected element
> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService'
> before the end of the content
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: XMLBeans regarding valid XML file as invalid?

Posted by Jacob Danner <ja...@gmail.com>.
I think the difference in the editor validation is you validated the
instance as XML (thats what eclipse does) which is different than
validating it against the schema type you had specified in your code.
-jacobd

On Tue, Jul 15, 2008 at 8:57 AM, Andre de Souza <ha...@bmi.osu.edu> wrote:
>
>
>  Yes, I validated the input XML using the XMLBeans API (see the java class
> attached to my 1st message) and the error message indicates the input is
> invalid. Since the editors I mentioned and I myself could not see anything
> wrong with the input file, I don't understand why XMLBeans is regarding it
> as invalid.
>  Could you take a look at the message XMLBeans reported and see if there's
> any inconsistency on the XML file I attached to my 1st message?
>
>  Thanks.
>
>  Andre de Souza
>
>
>
> Costello, Robert wrote:
>>
>> Have you tried validating the input against the schema using the
>> XMLBeans API?
>> xobj = XmlObject.Factory.parse(input, validateOptions);
>>
>> isValid = xobj.validate(validateOptions);
>>
>> I'm not familiar with Oxygen, but have run into other situations where I
>> have seen validation differences in APIs.  I've been very satisfied with
>> the level of stringency in XMLBeans.
>>
>> Robert Costello
>>
>>
>> -----Original Message-----
>> From: Andre de Souza [mailto:hawks@bmi.osu.edu] Sent: Tuesday, July 15,
>> 2008 10:23 AM
>> To: user@xmlbeans.apache.org
>> Subject: XMLBeans regarding valid XML file as invalid?
>>
>>
>>
>>   Hi all,
>>
>>
>>   I used scomp to generate a parser for an XML file which root element is
>> expected to be "WorkflowManagerInstanceDescriptor". The input file for scomp
>> is the attached "WorkflowManager.xsd" file.
>>   I created an XML file (UnsecureWorkflow1.xml) and validated it against
>> the schema using both Eclipse and Oxygen. For that reason, I believe the XML
>> file is valid.
>>   However, when parsing it using the generated XMLBeans parser, I can't
>>
>> retrieve the information. Executing the attached java class gives an error
>> message that claims the XML file isn't valid. So, have scomp not generated
>> the parser appropriately or is one of my files invalid?
>>
>>
>>
>>
>> error: cvc-complex-type.2.4a: Expected element
>> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
>> owManagerService' instead of
>> 'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflo
>> w.cagrid.org/WorkflowManagerService' here
>> error: cvc-complex-type.2.4c: Expected element
>> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
>> owManagerService' before the end of the content
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: XMLBeans regarding valid XML file as invalid?

Posted by Andre de Souza <ha...@bmi.osu.edu>.

   Yes, I validated the input XML using the XMLBeans API (see the java 
class attached to my 1st message) and the error message indicates the 
input is invalid. Since the editors I mentioned and I myself could not 
see anything wrong with the input file, I don't understand why XMLBeans 
is regarding it as invalid.
   Could you take a look at the message XMLBeans reported and see if 
there's any inconsistency on the XML file I attached to my 1st message?

   Thanks.

  Andre de Souza



Costello, Robert wrote:
> Have you tried validating the input against the schema using the
> XMLBeans API? 
> 
> xobj = XmlObject.Factory.parse(input, validateOptions);
> 
> isValid = xobj.validate(validateOptions);
> 
> I'm not familiar with Oxygen, but have run into other situations where I
> have seen validation differences in APIs.  I've been very satisfied with
> the level of stringency in XMLBeans.  
> 
> 
> Robert Costello
> 
>  
> 
> -----Original Message-----
> From: Andre de Souza [mailto:hawks@bmi.osu.edu] 
> Sent: Tuesday, July 15, 2008 10:23 AM
> To: user@xmlbeans.apache.org
> Subject: XMLBeans regarding valid XML file as invalid?
> 
> 
> 
>    Hi all,
> 
> 
>    I used scomp to generate a parser for an XML file which root element 
> is expected to be "WorkflowManagerInstanceDescriptor". The input file 
> for scomp is the attached "WorkflowManager.xsd" file.
>    I created an XML file (UnsecureWorkflow1.xml) and validated it 
> against the schema using both Eclipse and Oxygen. For that reason, I 
> believe the XML file is valid.
>    However, when parsing it using the generated XMLBeans parser, I can't
> 
> retrieve the information. Executing the attached java class gives an 
> error message that claims the XML file isn't valid. So, have scomp not 
> generated the parser appropriately or is one of my files invalid?
> 
> 
> 
> 
> error: cvc-complex-type.2.4a: Expected element 
> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
> owManagerService' 
> instead of 
> 'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflo
> w.cagrid.org/WorkflowManagerService' 
> here
> error: cvc-complex-type.2.4c: Expected element 
> 'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
> owManagerService' 
> before the end of the content
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: XMLBeans regarding valid XML file as invalid?

Posted by "Costello, Robert" <rc...@searshc.com>.
Have you tried validating the input against the schema using the
XMLBeans API? 

xobj = XmlObject.Factory.parse(input, validateOptions);

isValid = xobj.validate(validateOptions);

I'm not familiar with Oxygen, but have run into other situations where I
have seen validation differences in APIs.  I've been very satisfied with
the level of stringency in XMLBeans.  


Robert Costello

 

-----Original Message-----
From: Andre de Souza [mailto:hawks@bmi.osu.edu] 
Sent: Tuesday, July 15, 2008 10:23 AM
To: user@xmlbeans.apache.org
Subject: XMLBeans regarding valid XML file as invalid?



   Hi all,


   I used scomp to generate a parser for an XML file which root element 
is expected to be "WorkflowManagerInstanceDescriptor". The input file 
for scomp is the attached "WorkflowManager.xsd" file.
   I created an XML file (UnsecureWorkflow1.xml) and validated it 
against the schema using both Eclipse and Oxygen. For that reason, I 
believe the XML file is valid.
   However, when parsing it using the generated XMLBeans parser, I can't

retrieve the information. Executing the attached java class gives an 
error message that claims the XML file isn't valid. So, have scomp not 
generated the parser appropriately or is one of my files invalid?




error: cvc-complex-type.2.4a: Expected element 
'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
owManagerService' 
instead of 
'WorkflowManagerInstanceDescriptor@http://workflowmanagerservice.workflo
w.cagrid.org/WorkflowManagerService' 
here
error: cvc-complex-type.2.4c: Expected element 
'localWorkflows@http://workflowmanagerservice.workflow.cagrid.org/Workfl
owManagerService' 
before the end of the content









---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org