[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    Re: Suppress prefix validation in the XML -Message
From:       Jacob Danner <jacob.danner () gmail ! com>
Date:       2009-07-25 22:24:11
Message-ID: bb04eb0a0907251524o2e3aa3bao31ae75616fd6beb0 () mail ! gmail ! com
[Download RAW message or body]

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<henry_human@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<henry_human@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
>
>

[Attachment #3 (text/html)]

A) Take a peek at<br><a \
href="http://xmlbeans.apache.org/docs/2.0.0/guide/conValidationWithXmlBeans.html#valid \
ation_apis">http://xmlbeans.apache.org/docs/2.0.0/guide/conValidationWithXmlBeans.html#validation_apis</a><br><br>
 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.<br><br><br>B) In your example payload, you have<br> \
&lt;response    xmlns=&quot;<a \
href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot; xmlns:ns1=&quot;<a \
href="http://kkk/xsx.org/">http://kkk/xsx.org/</a>&quot;&gt;<br>   \
&lt;ns1:something&gt;<br>...<br>and you are saying that when you remove the namespace \
prefix everything works fine. <br> I&#39;m saying that instance is NOT the same as \
the one you posted.<br>For example, if you remove the prefix on the &lt;something \
/&gt; 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. <br> In long form: (before)<br>&lt;response    xmlns=&quot;<a \
href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot; &gt;<br>   \
&lt;something <b>xmlns=&quot;<a \
                href="http://kkk/xsx.org/">http://kkk/xsx.org/</a>&quot;</b>&gt;<br>
...<br>(after removing the prefix)<br>&lt;response    xmlns=&quot;<a \
href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot; &gt;<br>   \
&lt;something <b>xmlns=&quot;<a \
href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot;</b>&gt;<br> <br>Does \
that help you see the difference? I also imagine the additional error messages will \
state something about &#39;found element <a \
href="mailto:something@xsx.org">something@xsx.org</a>, but expected \
something@xsxs&quot;<br> <br>HTH,<br>-jacobd<br><br><br>On Sat, Jul 25, 2009 at 11:16 \
AM, Henry A&lt;<a href="mailto:henry_human@yahoo.de">henry_human@yahoo.de</a>&gt; \
wrote:<br>&gt;<br>&gt;&gt;from what you describe it sounds like you might have a \
validation<br> &gt; a)<br>&gt; The only message after validating of response i get is \
a boolean value:false<br>&gt;<br>&gt; //hier is the validation<br>&gt; \
responseDoc.Factory.parse(respons_decoded).validate();<br>&gt; Are there other \
options to get more validation data from the xmlbean!?<br> &gt;<br>&gt; b)<br>&gt; I \
do not understand what you mean, they are total different messages??<br>&gt; The \
message 1 you see below is the original response<br>&gt; The message 2 is the \
original response after i removed the prefixes<br> &gt; ??<br>&gt; strange enough, \
after removing the ns1: from tags, xmlbeans does process<br>&gt;  the response fine \
but still the validation value of document is false!<br>&gt;<br>&gt; ??<br>&gt; \
-----------------------------<br> &gt;<br>&gt;<br>&gt;<br>&gt; Jacob Danner-2 \
wrote:<br>&gt;&gt;<br>&gt;&gt; from what you describe it sounds like you might have a \
validation<br>&gt;&gt; issue with the instance. Have you tried validating and seen if \
there<br> &gt;&gt; are errors?<br>&gt;&gt;<br>&gt;&gt; This:<br>&gt;&gt; &lt;response \
xmlns=&quot;<a href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot;<br>&gt;&gt; \
xmlns:ns1=&quot;<a href="http://kkk/xsx.org/">http://kkk/xsx.org/</a>&quot;&gt;<br> \
&gt;&gt;     &lt;ns1:something&gt;<br>&gt;&gt;     &lt;ns1:mn&gt; and so \
on&lt;/ns1:mn&gt;<br>&gt;&gt;     &lt;/ns1:something&gt;<br>&gt;&gt; \
&lt;/response&gt;<br>&gt;&gt;<br>&gt;&gt; compared to this:<br>&gt;&gt; &lt;response  \
xmlns=&quot;<a href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot;<br> \
&gt;&gt; xmlns:ns1=&quot;<a \
href="http://kkk/xsx.org/">http://kkk/xsx.org/</a>&quot;&gt;<br>&gt;&gt;     \
&lt;something&gt;<br>&gt;&gt;     &lt;mn&gt; and so on&lt;/mn&gt;<br>&gt;&gt;     \
&lt;/something&gt;<br>&gt;&gt;   &lt;/response&gt;<br> &gt;&gt;<br>&gt;&gt; are \
actually quite different.<br>&gt;&gt; If you still need help, please let us know what \
the validation errors are.<br>&gt;&gt;<br>&gt;&gt; \
-jacobd<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; On Sat, Jul 25, 2009 at 6:41 AM, Henry \
A&lt;<a href="mailto:henry_human@yahoo.de">henry_human@yahoo.de</a>&gt; wrote:<br> \
&gt;&gt;&gt;<br>&gt;&gt;&gt; The message that my client gets from service looks lik \
this:<br>&gt;&gt;&gt; &lt;response    xmlns=&quot;<a \
href="http://kkk/schema/xsxs">http://kkk/schema/xsxs</a>&quot;<br>&gt;&gt;&gt; \
xmlns:ns1=&quot;<a href="http://kkk/xsx.org/">http://kkk/xsx.org/</a>&quot;&gt;<br> \
&gt;&gt;&gt;    &lt;ns1:something&gt;<br>&gt;&gt;&gt;    &lt;ns1:mn&gt; and so \
on&lt;/ns1:mn&gt;<br>&gt;&gt;&gt;    &lt;/ns1:something&gt;<br>&gt;&gt;&gt;  \
&lt;/response&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Because the prefix ns1 is used in \
the message, the xmlbenas in client<br> &gt;&gt;&gt; fails<br>&gt;&gt;&gt; with an \
error!<br>&gt;&gt;&gt;  But when I remove the prefix from xml response and then \
handover to the<br>&gt;&gt;&gt; xmlbean works fine.<br>&gt;&gt;&gt;  How can I say \
xmlbeans to understand the prefix in the message?<br> &gt;&gt;&gt;  Thanks for your \
hint in advance.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; \
--<br>&gt;&gt;&gt; View this message in context:<br>&gt;&gt;&gt; <a \
href="http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p \
24658040.html">http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html</a><br>
 &gt;&gt;&gt; Sent from the Xml Beans - User mailing list archive at \
Nabble.com.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; \
---------------------------------------------------------------------<br>&gt;&gt;&gt; \
To unsubscribe, e-mail: <a \
href="mailto:user-unsubscribe@xmlbeans.apache.org">user-unsubscribe@xmlbeans.apache.org</a><br>
 &gt;&gt;&gt; For additional commands, e-mail: <a \
href="mailto:user-help@xmlbeans.apache.org">user-help@xmlbeans.apache.org</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; \
---------------------------------------------------------------------<br> &gt;&gt; To \
unsubscribe, e-mail: <a \
href="mailto:user-unsubscribe@xmlbeans.apache.org">user-unsubscribe@xmlbeans.apache.org</a><br>&gt;&gt; \
For additional commands, e-mail: <a \
href="mailto:user-help@xmlbeans.apache.org">user-help@xmlbeans.apache.org</a><br> \
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt; --<br>&gt; View this message in \
context: <a href="http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message \
-tp24658040p24660279.html">http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24660279.html</a><br>
 &gt; Sent from the Xml Beans - User mailing list archive at \
Nabble.com.<br>&gt;<br>&gt;<br>&gt; \
---------------------------------------------------------------------<br>&gt; To \
unsubscribe, e-mail: <a \
href="mailto:user-unsubscribe@xmlbeans.apache.org">user-unsubscribe@xmlbeans.apache.org</a><br>
 &gt; For additional commands, e-mail: <a \
href="mailto:user-help@xmlbeans.apache.org">user-help@xmlbeans.apache.org</a><br>&gt;<br>&gt;<br><br>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic