[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: Re: Hi Issue with Parsing....
From: Juha_Mäkeläinen <juha.makelainen () op ! fi>
Date: 2007-01-18 9:38:43
Message-ID: 8427529.post () talk ! nabble ! com
[Download RAW message or body]
Quite simple, (as soon the answer is found :)
XmlOptions opts = new XmlOptions();
opts.setDocumentType(MyXMLBeansDocument.type);
MyXMLBeansDocument dok = MyXMLBeansDocument.Factory.parse(myXmlAsString,
opts);
Yes, the parse method can have more tha one argument.
(I think the turorials jump over the most basic examples.)
Juha
Juha Mäkeläinen wrote:
>
> How about parsing an XML document which I can't change? How I can tell the
> right xmlns namespace to the parser, if the input message doesn't have an
> "xmlns=" attribute?
>
> (Of course I could edit my input string and insert an "xmlns=..." clause
> ;)
>
> Juha
>
>
> Edward Frederick wrote:
>>
>> Hi Ramesh,
>>
>> Although I don't have a copy of your schema, it appears you're
>> namespace qualified.
>>
>> Depending on if you have elementFormDefault="unqualified" (the
>> default) or "qualified", you may also have to qualify the elements
>> within your document element.
>>
>> In short, one these should work:
>>
>>
>> <WFHMEnvelope xmlns="http://service.wellsfargo.com/provider/emf/">
>> <eMFContext>
>> <sessionid>9bd99e77-8ddd-11da-9be1-b7656329eea5</sessionid>
>> ... etc..
>> </WFHMEnvelope>
>>
>> or ...
>>
>> Let me know how it goes!
>>
>> Ed
>>
>>
>> On 2/2/06, Ramesh.Chitturi@wellsfargo.com
>> <Ramesh.Chitturi@wellsfargo.com> wrote:
>>> Hi Edward,
>>>
>>> This is the string I am parsing...I am trying to print the service
>>> element value...
>>>
>>> <WFHMEnvelope>
>>> <eMFContext>
>>> <sessionid>9bd99e77-8ddd-11da-9be1-b7656329eea5</sessionid>
>>> ...
>>> </eMFContext>
>>> </WFHMEnvelope>
>>>
>>> Thanks
>>> Ramesh.
>>>
>>> -----Original Message-----
>>> From: Edward Frederick [mailto:epfrederick@gmail.com]
>>> Sent: Thursday, February 02, 2006 2:09 PM
>>> To: dev@xmlbeans.apache.org
>>> Subject: Re: Hi Issue with Parsing....
>>>
>>> Can you provide the XML String? I think there are a couple
>>> possibilities.
>>>
>>> On 2/2/06, Ramesh.Chitturi@wellsfargo.com
>>> <Ramesh.Chitturi@wellsfargo.com> wrote:
>>> >
>>> > I am new to XmlBeans I got this exception while parsing the xml
>>> String.
>>> >
>>> > org.apache.xmlbeans.XmlException:
>>> > c:\ramesh\ResponseSample.xml:0: error: The document is not a
>>> > WFHMEnvelope@http://service.wellsfargo.com/provider/emf/:
>>> > document element namespace mismatch expected
>>> > "http://service.wellsfargo.com/provider/emf/" got ""
>>> > ...
>>> >
>>> > Thanks
>>> > Ramesh.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Hi-Issue-with-Parsing....-tf1048876.html#a8427529
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic