You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Eugen Okon <Eu...@gmx.de> on 2008/12/15 10:41:52 UTC

parse a part of xml

Hello,
i am new to xmlbeans, so maybe my question is a kind of “basics” for the framework. I am writing an application which communicates with Ms Project PSI Web Services. The application gets a SOAP response from Ms Project. The structure of this response is described below:

<soap:envelope>
…..
<soap:body>
<ReadProjectResponse>
	…
		<ProjectDataSet>
			Information I need!!!!
</ProjectDataSet>
	…
<ReadProjectResponse>
</soap:body>
</soap:envelope>

Ok so now I can finally describe the problem. I have a xsd schema which models the structure of <ProjectDataSet>. From these xsd I’ve generated java code with xmlbeans’s ant task. Now I am searching for an elegant possibility to parse this kind of responses. This means ProjectDataSetDocument.Factory.parse(is); should parse the inputstream beginning with the <ProjectDataSet>. In other cases I am understandably getting an exception. I hope someone can help me solving this problem.

Eugen 

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

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


Re: parse a part of xml

Posted by Eugen Okon <Eu...@gmx.de>.
Hi Jacob,
thanks a lot for your answer!
There is no problem to get the values of the projectdataset, in the case that i copy/paste the 
<ProjectDataSet>
                       Information I need!!!!
</ProjectDataSet>
part to a new file and use it. The exception is caused (in my opinion) because the root element of the doc i am trying to parse is <soap:envelope> and not <ProjectDataSet>. What i am searching for is a possibility to tell the parser to skip all tags till <ProjectDataSet>. The Exception i get is:

error: The document is not a ProjectDataSet@http://schemas.microsoft.com/office/project/server/webservices/ProjectDataSet/: document element mismatch got Envelope@http://schemas.xmlsoap.org/soap/envelope/
	at org.apache.xmlbeans.impl.store.Locale.verifyDocumentType(Locale.java:458)
	at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:363)

with best regards
Eugen
-------- Original-Nachricht --------
> Datum: Mon, 15 Dec 2008 09:15:22 -0800
> Von: "Jacob Danner" <ja...@gmail.com>
> An: user@xmlbeans.apache.org
> Betreff: Re: parse a part of xml

> Hi Eugen,
> Are you having troubles getting the value of the projectdataset
> element or are you just getting an exception when you are trying to
> parse it?
> Is there a projectDatasetType Class available? Have you tried that?
> What is the exception you are seeing?
> -jacobd
> 
> On Mon, Dec 15, 2008 at 1:41 AM, Eugen Okon <Eu...@gmx.de> wrote:
> > Hello,
> > i am new to xmlbeans, so maybe my question is a kind of "basics" for the
> framework. I am writing an application which communicates with Ms Project
> PSI Web Services. The application gets a SOAP response from Ms Project. The
> structure of this response is described below:
> >
> > <soap:envelope>
> > …..
> > <soap:body>
> > <ReadProjectResponse>
> >        …
> >                <ProjectDataSet>
> >                        Information I need!!!!
> > </ProjectDataSet>
> >        …
> > <ReadProjectResponse>
> > </soap:body>
> > </soap:envelope>
> >
> > Ok so now I can finally describe the problem. I have a xsd schema which
> models the structure of <ProjectDataSet>. From these xsd I've generated
> java code with xmlbeans's ant task. Now I am searching for an elegant
> possibility to parse this kind of responses. This means
> ProjectDataSetDocument.Factory.parse(is); should parse the inputstream beginning with the
> <ProjectDataSet>. In other cases I am understandably getting an exception. I hope
> someone can help me solving this problem.
> >
> > Eugen
> >
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> allen: http://www.gmx.net/de/go/multimessenger
> >
> > ---------------------------------------------------------------------
> > 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

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a

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


Re: parse a part of xml

Posted by Jacob Danner <ja...@gmail.com>.
Hi Eugen,
Are you having troubles getting the value of the projectdataset
element or are you just getting an exception when you are trying to
parse it?
Is there a projectDatasetType Class available? Have you tried that?
What is the exception you are seeing?
-jacobd

On Mon, Dec 15, 2008 at 1:41 AM, Eugen Okon <Eu...@gmx.de> wrote:
> Hello,
> i am new to xmlbeans, so maybe my question is a kind of "basics" for the framework. I am writing an application which communicates with Ms Project PSI Web Services. The application gets a SOAP response from Ms Project. The structure of this response is described below:
>
> <soap:envelope>
> …..
> <soap:body>
> <ReadProjectResponse>
>        …
>                <ProjectDataSet>
>                        Information I need!!!!
> </ProjectDataSet>
>        …
> <ReadProjectResponse>
> </soap:body>
> </soap:envelope>
>
> Ok so now I can finally describe the problem. I have a xsd schema which models the structure of <ProjectDataSet>. From these xsd I've generated java code with xmlbeans's ant task. Now I am searching for an elegant possibility to parse this kind of responses. This means ProjectDataSetDocument.Factory.parse(is); should parse the inputstream beginning with the <ProjectDataSet>. In other cases I am understandably getting an exception. I hope someone can help me solving this problem.
>
> Eugen
>
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
>
> ---------------------------------------------------------------------
> 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