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 David Remy <dr...@bea.com> on 2004/04/13 20:16:10 UTC

RE: XmlException while parsing an XML file

Sudarshana Murthy wrote:
> Some more information related to this problem:

i am cross posting this on to the user list since this is *probably* more appropriate there.

> 
> 1. The schema definition files do not have "targetNamespace"
> declaration 

so the schema is in no namespace (something to avoid if possible).  similar to java files with no package.

> 
> 2. The xsdconfig file used to compile the schema files is:
> 
>   <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">   
>     <xb:namespace>
>   <xb:package>com.myproject.xmlbeans.response</xb:package>   
> </xb:namespace> </xb:config> 

to map "no namespace" I believe you need to add an attribute onto the <xb:namespace> element.  did you try:
     <xb:namespace uri="">

> 
> 3. The XML file do not have namespace declaration

this is correct assuming no namespace. 

> 
> Please let me know if the xsdconfig file looks OK.
> 
> Once again appreciate your response.
> 
> Thanks
> Sudi
> 
> On Mon, 12 Apr 2004 14:29:33 -0400, "Sudarshana Murthy"
> <sp...@fastmail.fm> said:
>> Eric,
>> 
>> Thanks for your response.
>> 
>> The factory does match the xml (i didn't see any obvious mis-match).
>> Only thing is the xml document is missing namespace element/tag. Do
>> you think this might cause a problem? I have seen couple of postings
>> in weblogic.developer.interest.xmlbeans with the same problem as i
>> am seeing currently. 
>> 
>> Thanks
>> Sudi
>> On Mon, 12 Apr 2004 09:42:10 -0700, "Eric Vasilik" <er...@bea.com>
>> said:
>>> With out more information, I think this exception is thrown when
>>> you use a factory of a specific compiled schema type, and the xml
>>> you are parsing is not of that type. 
>>> 
>>> So, if you say FooDocument.Factory.parse( "<bar/>" ), because
>>> FooDocument must have a <foo> as the document element, finding a
>>> <bar> as the document element will cause this exception to be
>>> thrown. 
>>> 
>>> - Eric
>>> 
>>> -----Original Message-----
>>> From: Sudarshana Murthy [mailto:spoorthy@fastmail.fm]
>>> Sent: Monday, April 12, 2004 7:16 AM
>>> To: xmlbeans-dev@xml.apache.org
>>> Subject: XmlException while parsing an XML file
>>> 
>>> Hi,
>>> 
>>> I am getting the XmlException while parsing an XML file. This
>>> exception gets thrown as soon as the method
>>> OuterDocument.Factory.parse(xmlFileName) gets called. I tried
>>> changing the XML document (adding "xmlns" tag) a little, but having
>>> no luck still. The XML document that i am trying to parse starts
>>> with <?xml version="1.0" encoding="ISO-8859-1" ?>
>>> 
>>> The error i am getting is:
>>> 
>>>     XmlException: XML object is not of type D=ROOTDOCUMENT
>>> 
>>> Has anyone seen this problem before? Please let me know of any
>>> workaround to fix this.
>>> 
>>> Appreciate your response
>>> Sudi
>>> 
>>> --
>>> http://www.fastmail.fm - Or how I learned to stop worrying and
>>>                           love email again
>>> 
>>> -
> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
>>> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
>>> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>>> 
>>> 
>>> -
> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
>>> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
>>> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
>>> 
>> 
>> --
>> http://www.fastmail.fm - Sent 0.000002 seconds ago
>> 
>> -
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
>> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
>> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

- ---------------------------------------------------------------------
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: XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
David,

Appreciate your response. 

Thanks a lot for cross posting this on the user list. I agree with you
this is more appropriate there.

> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">

I tried with the above change, still it gives me the same error. The
schema files are published by a vendor and we are consuming their service
(so we can't change the schema). Also, if i add the attribute
<xb:namespace uri=""> then all the generated classes are put under
"noNameSpace" package (should it be this way always?)

Thanks
Sudi
On Tue, 13 Apr 2004 11:16:10 -0700, "David Remy" <dr...@bea.com> said:
> Sudarshana Murthy wrote:
> > Some more information related to this problem:
> 
> i am cross posting this on to the user list since this is *probably* more
> appropriate there.
> 
> > 
> > 1. The schema definition files do not have "targetNamespace"
> > declaration 
> 
> so the schema is in no namespace (something to avoid if possible). 
> similar to java files with no package.
> 
> > 
> > 2. The xsdconfig file used to compile the schema files is:
> > 
> >   <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">   
> >     <xb:namespace>
> >   <xb:package>com.myproject.xmlbeans.response</xb:package>   
> > </xb:namespace> </xb:config> 
> 
> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">
> 
> > 
> > 3. The XML file do not have namespace declaration
> 
> this is correct assuming no namespace. 
> 
> > 
> > Please let me know if the xsdconfig file looks OK.
> > 
> > Once again appreciate your response.
> > 
> > Thanks
> > Sudi
> > 
> > On Mon, 12 Apr 2004 14:29:33 -0400, "Sudarshana Murthy"
> > <sp...@fastmail.fm> said:
> >> Eric,
> >> 
> >> Thanks for your response.
> >> 
> >> The factory does match the xml (i didn't see any obvious mis-match).
> >> Only thing is the xml document is missing namespace element/tag. Do
> >> you think this might cause a problem? I have seen couple of postings
> >> in weblogic.developer.interest.xmlbeans with the same problem as i
> >> am seeing currently. 
> >> 
> >> Thanks
> >> Sudi
> >> On Mon, 12 Apr 2004 09:42:10 -0700, "Eric Vasilik" <er...@bea.com>
> >> said:
> >>> With out more information, I think this exception is thrown when
> >>> you use a factory of a specific compiled schema type, and the xml
> >>> you are parsing is not of that type. 
> >>> 
> >>> So, if you say FooDocument.Factory.parse( "<bar/>" ), because
> >>> FooDocument must have a <foo> as the document element, finding a
> >>> <bar> as the document element will cause this exception to be
> >>> thrown. 
> >>> 
> >>> - Eric
> >>> 
> >>> -----Original Message-----
> >>> From: Sudarshana Murthy [mailto:spoorthy@fastmail.fm]
> >>> Sent: Monday, April 12, 2004 7:16 AM
> >>> To: xmlbeans-dev@xml.apache.org
> >>> Subject: XmlException while parsing an XML file
> >>> 
> >>> Hi,
> >>> 
> >>> I am getting the XmlException while parsing an XML file. This
> >>> exception gets thrown as soon as the method
> >>> OuterDocument.Factory.parse(xmlFileName) gets called. I tried
> >>> changing the XML document (adding "xmlns" tag) a little, but having
> >>> no luck still. The XML document that i am trying to parse starts
> >>> with <?xml version="1.0" encoding="ISO-8859-1" ?>
> >>> 
> >>> The error i am getting is:
> >>> 
> >>>     XmlException: XML object is not of type D=ROOTDOCUMENT
> >>> 
> >>> Has anyone seen this problem before? Please let me know of any
> >>> workaround to fix this.
> >>> 
> >>> Appreciate your response
> >>> Sudi
> >>> 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

- ---------------------------------------------------------------------
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: XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
David,

Appreciate your response. 

Thanks a lot for cross posting this on the user list. I agree with you
this is more appropriate there.

> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">

I tried with the above change, still it gives me the same error. The
schema files are published by a vendor and we are consuming their service
(so we can't change the schema). Also, if i add the attribute
<xb:namespace uri=""> then all the generated classes are put under
"noNameSpace" package (should it be this way always?)

Thanks
Sudi
On Tue, 13 Apr 2004 11:16:10 -0700, "David Remy" <dr...@bea.com> said:
> Sudarshana Murthy wrote:
> > Some more information related to this problem:
> 
> i am cross posting this on to the user list since this is *probably* more
> appropriate there.
> 
> > 
> > 1. The schema definition files do not have "targetNamespace"
> > declaration 
> 
> so the schema is in no namespace (something to avoid if possible). 
> similar to java files with no package.
> 
> > 
> > 2. The xsdconfig file used to compile the schema files is:
> > 
> >   <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">   
> >     <xb:namespace>
> >   <xb:package>com.myproject.xmlbeans.response</xb:package>   
> > </xb:namespace> </xb:config> 
> 
> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">
> 
> > 
> > 3. The XML file do not have namespace declaration
> 
> this is correct assuming no namespace. 
> 
> > 
> > Please let me know if the xsdconfig file looks OK.
> > 
> > Once again appreciate your response.
> > 
> > Thanks
> > Sudi
> > 
> > On Mon, 12 Apr 2004 14:29:33 -0400, "Sudarshana Murthy"
> > <sp...@fastmail.fm> said:
> >> Eric,
> >> 
> >> Thanks for your response.
> >> 
> >> The factory does match the xml (i didn't see any obvious mis-match).
> >> Only thing is the xml document is missing namespace element/tag. Do
> >> you think this might cause a problem? I have seen couple of postings
> >> in weblogic.developer.interest.xmlbeans with the same problem as i
> >> am seeing currently. 
> >> 
> >> Thanks
> >> Sudi
> >> On Mon, 12 Apr 2004 09:42:10 -0700, "Eric Vasilik" <er...@bea.com>
> >> said:
> >>> With out more information, I think this exception is thrown when
> >>> you use a factory of a specific compiled schema type, and the xml
> >>> you are parsing is not of that type. 
> >>> 
> >>> So, if you say FooDocument.Factory.parse( "<bar/>" ), because
> >>> FooDocument must have a <foo> as the document element, finding a
> >>> <bar> as the document element will cause this exception to be
> >>> thrown. 
> >>> 
> >>> - Eric
> >>> 
> >>> -----Original Message-----
> >>> From: Sudarshana Murthy [mailto:spoorthy@fastmail.fm]
> >>> Sent: Monday, April 12, 2004 7:16 AM
> >>> To: xmlbeans-dev@xml.apache.org
> >>> Subject: XmlException while parsing an XML file
> >>> 
> >>> Hi,
> >>> 
> >>> I am getting the XmlException while parsing an XML file. This
> >>> exception gets thrown as soon as the method
> >>> OuterDocument.Factory.parse(xmlFileName) gets called. I tried
> >>> changing the XML document (adding "xmlns" tag) a little, but having
> >>> no luck still. The XML document that i am trying to parse starts
> >>> with <?xml version="1.0" encoding="ISO-8859-1" ?>
> >>> 
> >>> The error i am getting is:
> >>> 
> >>>     XmlException: XML object is not of type D=ROOTDOCUMENT
> >>> 
> >>> Has anyone seen this problem before? Please let me know of any
> >>> workaround to fix this.
> >>> 
> >>> Appreciate your response
> >>> Sudi
> >>> 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

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


RE: XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
David,

Appreciate your response. 

Thanks a lot for cross posting this on the user list. I agree with you
this is more appropriate there.

> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">

I tried with the above change, still it gives me the same error. The
schema files are published by a vendor and we are consuming their service
(so we can't change the schema). Also, if i add the attribute
<xb:namespace uri=""> then all the generated classes are put under
"noNameSpace" package (should it be this way always?)

Thanks
Sudi
On Tue, 13 Apr 2004 11:16:10 -0700, "David Remy" <dr...@bea.com> said:
> Sudarshana Murthy wrote:
> > Some more information related to this problem:
> 
> i am cross posting this on to the user list since this is *probably* more
> appropriate there.
> 
> > 
> > 1. The schema definition files do not have "targetNamespace"
> > declaration 
> 
> so the schema is in no namespace (something to avoid if possible). 
> similar to java files with no package.
> 
> > 
> > 2. The xsdconfig file used to compile the schema files is:
> > 
> >   <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">   
> >     <xb:namespace>
> >   <xb:package>com.myproject.xmlbeans.response</xb:package>   
> > </xb:namespace> </xb:config> 
> 
> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">
> 
> > 
> > 3. The XML file do not have namespace declaration
> 
> this is correct assuming no namespace. 
> 
> > 
> > Please let me know if the xsdconfig file looks OK.
> > 
> > Once again appreciate your response.
> > 
> > Thanks
> > Sudi
> > 
> > On Mon, 12 Apr 2004 14:29:33 -0400, "Sudarshana Murthy"
> > <sp...@fastmail.fm> said:
> >> Eric,
> >> 
> >> Thanks for your response.
> >> 
> >> The factory does match the xml (i didn't see any obvious mis-match).
> >> Only thing is the xml document is missing namespace element/tag. Do
> >> you think this might cause a problem? I have seen couple of postings
> >> in weblogic.developer.interest.xmlbeans with the same problem as i
> >> am seeing currently. 
> >> 
> >> Thanks
> >> Sudi
> >> On Mon, 12 Apr 2004 09:42:10 -0700, "Eric Vasilik" <er...@bea.com>
> >> said:
> >>> With out more information, I think this exception is thrown when
> >>> you use a factory of a specific compiled schema type, and the xml
> >>> you are parsing is not of that type. 
> >>> 
> >>> So, if you say FooDocument.Factory.parse( "<bar/>" ), because
> >>> FooDocument must have a <foo> as the document element, finding a
> >>> <bar> as the document element will cause this exception to be
> >>> thrown. 
> >>> 
> >>> - Eric
> >>> 
> >>> -----Original Message-----
> >>> From: Sudarshana Murthy [mailto:spoorthy@fastmail.fm]
> >>> Sent: Monday, April 12, 2004 7:16 AM
> >>> To: xmlbeans-dev@xml.apache.org
> >>> Subject: XmlException while parsing an XML file
> >>> 
> >>> Hi,
> >>> 
> >>> I am getting the XmlException while parsing an XML file. This
> >>> exception gets thrown as soon as the method
> >>> OuterDocument.Factory.parse(xmlFileName) gets called. I tried
> >>> changing the XML document (adding "xmlns" tag) a little, but having
> >>> no luck still. The XML document that i am trying to parse starts
> >>> with <?xml version="1.0" encoding="ISO-8859-1" ?>
> >>> 
> >>> The error i am getting is:
> >>> 
> >>>     XmlException: XML object is not of type D=ROOTDOCUMENT
> >>> 
> >>> Has anyone seen this problem before? Please let me know of any
> >>> workaround to fix this.
> >>> 
> >>> Appreciate your response
> >>> Sudi
> >>> 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

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


RE: XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
David,

Appreciate your response. 

Thanks a lot for cross posting this on the user list. I agree with you
this is more appropriate there.

> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">

I tried with the above change, still it gives me the same error. The
schema files are published by a vendor and we are consuming their service
(so we can't change the schema). Also, if i add the attribute
<xb:namespace uri=""> then all the generated classes are put under
"noNameSpace" package (should it be this way always?)

Thanks
Sudi
On Tue, 13 Apr 2004 11:16:10 -0700, "David Remy" <dr...@bea.com> said:
> Sudarshana Murthy wrote:
> > Some more information related to this problem:
> 
> i am cross posting this on to the user list since this is *probably* more
> appropriate there.
> 
> > 
> > 1. The schema definition files do not have "targetNamespace"
> > declaration 
> 
> so the schema is in no namespace (something to avoid if possible). 
> similar to java files with no package.
> 
> > 
> > 2. The xsdconfig file used to compile the schema files is:
> > 
> >   <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">   
> >     <xb:namespace>
> >   <xb:package>com.myproject.xmlbeans.response</xb:package>   
> > </xb:namespace> </xb:config> 
> 
> to map "no namespace" I believe you need to add an attribute onto the
> <xb:namespace> element.  did you try:
>      <xb:namespace uri="">
> 
> > 
> > 3. The XML file do not have namespace declaration
> 
> this is correct assuming no namespace. 
> 
> > 
> > Please let me know if the xsdconfig file looks OK.
> > 
> > Once again appreciate your response.
> > 
> > Thanks
> > Sudi
> > 
> > On Mon, 12 Apr 2004 14:29:33 -0400, "Sudarshana Murthy"
> > <sp...@fastmail.fm> said:
> >> Eric,
> >> 
> >> Thanks for your response.
> >> 
> >> The factory does match the xml (i didn't see any obvious mis-match).
> >> Only thing is the xml document is missing namespace element/tag. Do
> >> you think this might cause a problem? I have seen couple of postings
> >> in weblogic.developer.interest.xmlbeans with the same problem as i
> >> am seeing currently. 
> >> 
> >> Thanks
> >> Sudi
> >> On Mon, 12 Apr 2004 09:42:10 -0700, "Eric Vasilik" <er...@bea.com>
> >> said:
> >>> With out more information, I think this exception is thrown when
> >>> you use a factory of a specific compiled schema type, and the xml
> >>> you are parsing is not of that type. 
> >>> 
> >>> So, if you say FooDocument.Factory.parse( "<bar/>" ), because
> >>> FooDocument must have a <foo> as the document element, finding a
> >>> <bar> as the document element will cause this exception to be
> >>> thrown. 
> >>> 
> >>> - Eric
> >>> 
> >>> -----Original Message-----
> >>> From: Sudarshana Murthy [mailto:spoorthy@fastmail.fm]
> >>> Sent: Monday, April 12, 2004 7:16 AM
> >>> To: xmlbeans-dev@xml.apache.org
> >>> Subject: XmlException while parsing an XML file
> >>> 
> >>> Hi,
> >>> 
> >>> I am getting the XmlException while parsing an XML file. This
> >>> exception gets thrown as soon as the method
> >>> OuterDocument.Factory.parse(xmlFileName) gets called. I tried
> >>> changing the XML document (adding "xmlns" tag) a little, but having
> >>> no luck still. The XML document that i am trying to parse starts
> >>> with <?xml version="1.0" encoding="ISO-8859-1" ?>
> >>> 
> >>> The error i am getting is:
> >>> 
> >>>     XmlException: XML object is not of type D=ROOTDOCUMENT
> >>> 
> >>> Has anyone seen this problem before? Please let me know of any
> >>> workaround to fix this.
> >>> 
> >>> Appreciate your response
> >>> Sudi
> >>> 

-- 
http://www.fastmail.fm - IMAP accessible web-mail

- ---------------------------------------------------------------------
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/