Thanks Dave for your response. Sorry, I was having element <INPUTS> in my XSD but I forgot to mention in my first email (copy/paste mistake)... In order to move forward, I set the namespace in my input XML string.. Now I am getting an error..which is java.lang.NullPointerException at org.apache.xmlbeans.impl.store.Root$LoadContext.checkNameAttr(Root.java:1428) at org.apache.xmlbeans.impl.store.Root$LoadContext.attr(Root.java:1558) at org.apache.xmlbeans.impl.store.Root.loadNode(Root.java:1808) at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1849) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:356) at testdomain.corange.INPUTSDocument$Factory.parse(Unknown Source) Any Idea why this error comes ? Thanks Kiran ------------------------------------------------- Ph: 312 742 9630 Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
________________________________ From: Dave Harrison [mailto:[EMAIL PROTECTED] Sent: Thu 6/23/2005 2:21 PM To: [email protected] Subject: Re: document element namespace mismatch Kiran, You're missing an important line in your Schema definition. You need to create a global element somewhere in the schema file, such as: <xsd:element name="INPUTS" type="gcindividual:INPUTS" /> This specifies the root element of your XML instance and will become the actual INPUTSDocument object when the file is parsed. Then you can parse the file with: XmlOptions opts = new XmlOptions(); Map<String, String> ns = new HashMap<String, String>(); ns.put("", "http://testdomain/gcindividual"); opts.setLoadSubstituteNamespaces(ns); INPUTSDocument inputsDoc = INPUTSDocument.Factory.parse( "<INPUTS><ADDRESS> <STREET>50 w washington st</STREET> </ADDRESS> </INPUTS>", opts); All the best, Dave H. Kiran Kumar wrote: >Thanks for your response. > >I tried with the following options, but it did not work.. > >I have tried with the following options.. but I was getting the same error.. > XmlOptions xopt = new XmlOptions(); > xopt.setUseDefaultNamespace(); > INPUTSDocument myInputsDoc = INPUTSDocument.Factory.parse(input,xopt); > >and also like this.. > > String namespace = "http://testdomain/gcindividual"; > HashMap m = new HashMap(); > m.put("",namespace); > xopt.setLoadSubstituteNamespaces(m); > >I was getting the same error ==>The document is not a [EMAIL >PROTECTED]://testdomain/gcindividual <mailto:[EMAIL >PROTECTED]://testdomain/gcindividual> : document element namespace mismatch >expected "http://testdomain/gcindividual <http://testdomain/gcindividual> " >got "" > >Thanks >Kiran >------------------------------------------------- >Ph: 312 742 9630 >Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > >________________________________ > >From: Jean-Christophe Pazzaglia [mailto:[EMAIL PROTECTED] >Sent: Wed 6/22/2005 8:42 AM >To: [email protected] >Subject: Re: document element namespace mismatch > > > >Speciyiyng the default namespace in INPUTS should make it >(according that you managed to compile your schema before >and marshalling is your issue) > >jc > > > >>Hi, Anybody has any inputs on my previous question.. Any help is >>highly appreciated. I have gone through google, could not get any >>solution. >> >>Thanks >>Kiran >>------------------------------------------------------------------------ >>*From:* Kiran Kumar [mailto:[EMAIL PROTECTED] >>*Sent:* Tue 6/21/2005 3:21 PM >>*To:* [email protected] >>*Subject:* document element namespace mismatch >> >>Hello, I am a newbie to this xmlbeans. I am trying to generate the >>bean using XML string. My input is some thing like >> >><INPUTS> <ADDRESS> <STREET>50 w washington st</STREET> </ADDRESS> >></INPUTS> >> >>I have the XSD like this : >><xsd:schema xmlns:gcindividual="http://testdomain/gcindividual" >>xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>targetNamespace="http://testdomain/gcindividual" >>elementFormDefault="qualified"> >> <xsd:complexType name="ADDRESS"> >> <xsd:sequence> >> <xsd:element name="STREET" type="xsd:string"/> >> </xsd:sequence> >> </xsd:complexType> >> <xsd:complexType name="INPUTS"> >> <xsd:sequence> >> <xsd:element name="ADDRESS" type="gcindividual:ADDRESS"/> >> </xsd:sequence> >></xsd> >> >>While parsing this into document bean I am getting the error " >>*document element namespace mismatch expected ...*". I always get the >>input in String format so I will not have namespace prefix.. Is there >>anyway we can tell XMLBeans to ignore namespaces ? >> >>Thanks >>Kiran >> >> >> > >-- >Jean-Christophe Pazzaglia, PhD <[EMAIL PROTECTED]> >Corporate communications >Tel: (+33) 4-93-00-26-78 >PGP Key available : http://www.eurecom.fr/~pazzagli/publickey.pgp >-- >Institut EurĂ©com - Office 029 >http://www.eurecom.fr/ >2229 Route des CrĂȘtes >BP 193 >06904 Sophia Antipolis, France >Fax: (+33) 4-93-00-26-27 > > > > > > > > > > > > > > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > >------------------------------------------------ > >This e-mail, and any attachments thereto, is confidential and is intended only >for the individual(s) named. If you are not the intended recipient, please >let us know by e-mail reply and delete it from your system; do not copy/save >this e-mail or disclose its contents to anyone. E-mail transmissions cannot >be guaranteed to be secure or error-free as the transmission could be >interrupted, corrupted, lost, destroyed, altered, arrive late or contain >viruses. ObjectWave does not accept liability for any errors or omissions in >the contents of this e-mail which arise as a result of e-mail transmission. >The views expressed in this e-mail do not necessarily reflect those of >ObjectWave or its affiliates. > >------------------------------------------------ > > > > >------------------------------------------------------------------------ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

