Mary, thank you very much for the tips.
Inline


----- Original Message ----
From: Mary Holstege <[email protected]>
To: General Mark Logic Developer Discussion <[email protected]>
Sent: Wednesday, August 26, 2009 6:17:51 PM
Subject: Re: [MarkLogic Dev General] Namespace error in xdmp:get-request-body


The 'xs' prefix is predefined for XQuery, but this is an error coming from
the parsing of XML. XML does not predefine any namespaces.  So your
fix is to provide the binding on the XML content (and one for xsi as well).

When you say you cannot add the proper namespace bindings for the
element, do you mean that this XML was created with XQuery and you
don't know how to get the right set of bindings in place?

Yes, I want to generate XML with xqueary from a schema. I expected that there 
should be available libraries, but couldn't find any.
I am still a newbie, may be someone can give me advice, what is the best 
approach to do that.

If you use direct constructors, you can just do it:
<File xmlns:xs="http://www.w3.org/2001/XMLSchema"/>

You can force the issue for sure by wrapping the computed constructor
in a dummy direct constructor:

<dummy xmlns:xs="http://www.w3.org/2001/XMLSchema";>{
element File { attribute xsi:type {"xs:base64Binary"} }
}</dummy>/*

I need to add the namespace bindings from the schema to the XML. Wrapping the 
computed constructor in dummy direct constructor with hardcoded namespaces 
works for now, but I still need a way for adding all the schema namespaces to 
the dummy constructory dynamically.
Any ideas how to achieve that?

Tim


//Mary

On Wed, 26 Aug 2009 00:10:58 -0700, Tim Frosh <[email protected]> wrote:

> Hi,
> 
> When I try to get the xml data using xdmp:get-request-body, I am getting  the 
> following error:
> 
> XDMP-DOCNONSBIND: xdmp:get-request-body("xml") -- No namespace binding for 
> prefix xs
> 
> The xml data looks like this:
> 
>    <File>
>      <Content xsi:type="xs:base64Binary"></Content>    
>    </File>
> 
> I expected that xs prefix is one of default namespaces and I don't have to 
> include it.
> If I add that namespace like this
> 
>     <File  xmlns:xs="http://www.w3.org/2001/XMLSchema";>
> 
> the error disappears, but I am not able to do that with computed element 
> constructors, because namespace keyword is not working.
> At least I couldn't figure out how to do that.
> 
> What are the possible solutions for this scenario?
> 
> Thanks in advance
> Tim

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general



      
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to