You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Henry A <he...@yahoo.de> on 2009/07/25 15:41:36 UTC
Suppress prefix validation in the XML -Message
The message that my client gets from service looks lik this:
<response xmlns="http://kkk/schema/xsxs" xmlns:ns1="http://kkk/xsx.org/">
<ns1:something>
<ns1:mn> and so on</ns1:mn>
</ns1:something>
</response>
Because the prefix ns1 is used in the message, the xmlbenas in client fails
with an error!
But when I remove the prefix from xml response and then handover to the
xmlbean works fine.
How can I say xmlbeans to understand the prefix in the message?
Thanks for your hint in advance.
--
View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: Suppress prefix validation in the XML -Message
Posted by Jacob Danner <ja...@gmail.com>.
A) Take a peek at
http://xmlbeans.apache.org/docs/2.0.0/guide/conValidationWithXmlBeans.html#validation_apis
you can set an error listener on the XMLOptions you pass into the validate
method and get much more useful information. The value of false means the
instance is not valid according to the schema.
B) In your example payload, you have
<response xmlns="http://kkk/schema/xsxs" xmlns:ns1="http://kkk/xsx.org/">
<ns1:something>
...
and you are saying that when you remove the namespace prefix everything
works fine.
I'm saying that instance is NOT the same as the one you posted.
For example, if you remove the prefix on the <something /> element, what is
the new QName on it? It inherits the namespace from the xmlns value. In the
example you posted the xmlns value and the value assigned to ns1 are not the
same.
In long form: (before)
<response xmlns="http://kkk/schema/xsxs" >
<something *xmlns="http://kkk/xsx.org/"*>
...
(after removing the prefix)
<response xmlns="http://kkk/schema/xsxs" >
<something *xmlns="http://kkk/schema/xsxs"*>
Does that help you see the difference? I also imagine the additional error
messages will state something about 'found element something@xsx.org, but
expected something@xsxs"
HTH,
-jacobd
On Sat, Jul 25, 2009 at 11:16 AM, Henry A<he...@yahoo.de> wrote:
>
>>from what you describe it sounds like you might have a validation
> a)
> The only message after validating of response i get is a boolean
value:false
>
> //hier is the validation
> responseDoc.Factory.parse(respons_decoded).validate();
> Are there other options to get more validation data from the xmlbean!?
>
> b)
> I do not understand what you mean, they are total different messages??
> The message 1 you see below is the original response
> The message 2 is the original response after i removed the prefixes
> ??
> strange enough, after removing the ns1: from tags, xmlbeans does process
> the response fine but still the validation value of document is false!
>
> ??
> -----------------------------
>
>
>
> Jacob Danner-2 wrote:
>>
>> from what you describe it sounds like you might have a validation
>> issue with the instance. Have you tried validating and seen if there
>> are errors?
>>
>> This:
>> <response xmlns="http://kkk/schema/xsxs"
>> xmlns:ns1="http://kkk/xsx.org/">
>> <ns1:something>
>> <ns1:mn> and so on</ns1:mn>
>> </ns1:something>
>> </response>
>>
>> compared to this:
>> <response xmlns="http://kkk/schema/xsxs"
>> xmlns:ns1="http://kkk/xsx.org/">
>> <something>
>> <mn> and so on</mn>
>> </something>
>> </response>
>>
>> are actually quite different.
>> If you still need help, please let us know what the validation errors
are.
>>
>> -jacobd
>>
>>
>> On Sat, Jul 25, 2009 at 6:41 AM, Henry A<he...@yahoo.de> wrote:
>>>
>>> The message that my client gets from service looks lik this:
>>> <response xmlns="http://kkk/schema/xsxs"
>>> xmlns:ns1="http://kkk/xsx.org/">
>>> <ns1:something>
>>> <ns1:mn> and so on</ns1:mn>
>>> </ns1:something>
>>> </response>
>>>
>>> Because the prefix ns1 is used in the message, the xmlbenas in client
>>> fails
>>> with an error!
>>> But when I remove the prefix from xml response and then handover to the
>>> xmlbean works fine.
>>> How can I say xmlbeans to understand the prefix in the message?
>>> Thanks for your hint in advance.
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html
>>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24660279.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
Re: Suppress prefix validation in the XML -Message
Posted by Pete Cordell <pe...@codalogic.com>.
Would it help if you posted the XSD schema?
Thanks,
Pete Cordell
Codalogic Ltd
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for C++ XML data binding
----- Original Message -----
From: "Henry A" <he...@yahoo.de>
To: <us...@xmlbeans.apache.org>
Sent: Saturday, July 25, 2009 7:16 PM
Subject: Re: Suppress prefix validation in the XML -Message
>from what you describe it sounds like you might have a validation
a)
The only message after validating of response i get is a boolean value:false
//hier is the validation
responseDoc.Factory.parse(respons_decoded).validate();
Are there other options to get more validation data from the xmlbean!?
b)
I do not understand what you mean, they are total different messages??
The message 1 you see below is the original response
The message 2 is the original response after i removed the prefixes
??
strange enough, after removing the ns1: from tags, xmlbeans does process
the response fine but still the validation value of document is false!
??
-----------------------------
Jacob Danner-2 wrote:
>
> from what you describe it sounds like you might have a validation
> issue with the instance. Have you tried validating and seen if there
> are errors?
>
> This:
> <response xmlns="http://kkk/schema/xsxs"
> xmlns:ns1="http://kkk/xsx.org/">
> <ns1:something>
> <ns1:mn> and so on</ns1:mn>
> </ns1:something>
> </response>
>
> compared to this:
> <response xmlns="http://kkk/schema/xsxs"
> xmlns:ns1="http://kkk/xsx.org/">
> <something>
> <mn> and so on</mn>
> </something>
> </response>
>
> are actually quite different.
> If you still need help, please let us know what the validation errors are.
>
> -jacobd
>
>
> On Sat, Jul 25, 2009 at 6:41 AM, Henry A<he...@yahoo.de> wrote:
>>
>> The message that my client gets from service looks lik this:
>> <response xmlns="http://kkk/schema/xsxs"
>> xmlns:ns1="http://kkk/xsx.org/">
>> <ns1:something>
>> <ns1:mn> and so on</ns1:mn>
>> </ns1:something>
>> </response>
>>
>> Because the prefix ns1 is used in the message, the xmlbenas in client
>> fails
>> with an error!
>> But when I remove the prefix from xml response and then handover to the
>> xmlbean works fine.
>> How can I say xmlbeans to understand the prefix in the message?
>> Thanks for your hint in advance.
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
--
View this message in context:
http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24660279.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
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: Suppress prefix validation in the XML -Message
Posted by Henry A <he...@yahoo.de>.
>from what you describe it sounds like you might have a validation
a)
The only message after validating of response i get is a boolean value:false
//hier is the validation
responseDoc.Factory.parse(respons_decoded).validate();
Are there other options to get more validation data from the xmlbean!?
b)
I do not understand what you mean, they are total different messages??
The message 1 you see below is the original response
The message 2 is the original response after i removed the prefixes
??
strange enough, after removing the ns1: from tags, xmlbeans does process
the response fine but still the validation value of document is false!
??
-----------------------------
Jacob Danner-2 wrote:
>
> from what you describe it sounds like you might have a validation
> issue with the instance. Have you tried validating and seen if there
> are errors?
>
> This:
> <response xmlns="http://kkk/schema/xsxs"
> xmlns:ns1="http://kkk/xsx.org/">
> <ns1:something>
> <ns1:mn> and so on</ns1:mn>
> </ns1:something>
> </response>
>
> compared to this:
> <response xmlns="http://kkk/schema/xsxs"
> xmlns:ns1="http://kkk/xsx.org/">
> <something>
> <mn> and so on</mn>
> </something>
> </response>
>
> are actually quite different.
> If you still need help, please let us know what the validation errors are.
>
> -jacobd
>
>
> On Sat, Jul 25, 2009 at 6:41 AM, Henry A<he...@yahoo.de> wrote:
>>
>> The message that my client gets from service looks lik this:
>> <response xmlns="http://kkk/schema/xsxs"
>> xmlns:ns1="http://kkk/xsx.org/">
>> <ns1:something>
>> <ns1:mn> and so on</ns1:mn>
>> </ns1:something>
>> </response>
>>
>> Because the prefix ns1 is used in the message, the xmlbenas in client
>> fails
>> with an error!
>> But when I remove the prefix from xml response and then handover to the
>> xmlbean works fine.
>> How can I say xmlbeans to understand the prefix in the message?
>> Thanks for your hint in advance.
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
--
View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24660279.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
Re: Suppress prefix validation in the XML -Message
Posted by Jacob Danner <ja...@gmail.com>.
from what you describe it sounds like you might have a validation
issue with the instance. Have you tried validating and seen if there
are errors?
This:
<response xmlns="http://kkk/schema/xsxs" xmlns:ns1="http://kkk/xsx.org/">
<ns1:something>
<ns1:mn> and so on</ns1:mn>
</ns1:something>
</response>
compared to this:
<response xmlns="http://kkk/schema/xsxs" xmlns:ns1="http://kkk/xsx.org/">
<something>
<mn> and so on</mn>
</something>
</response>
are actually quite different.
If you still need help, please let us know what the validation errors are.
-jacobd
On Sat, Jul 25, 2009 at 6:41 AM, Henry A<he...@yahoo.de> wrote:
>
> The message that my client gets from service looks lik this:
> <response xmlns="http://kkk/schema/xsxs" xmlns:ns1="http://kkk/xsx.org/">
> <ns1:something>
> <ns1:mn> and so on</ns1:mn>
> </ns1:something>
> </response>
>
> Because the prefix ns1 is used in the message, the xmlbenas in client fails
> with an error!
> But when I remove the prefix from xml response and then handover to the
> xmlbean works fine.
> How can I say xmlbeans to understand the prefix in the message?
> Thanks for your hint in advance.
>
>
>
> --
> View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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