cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suzan Foster ...@islief.nl>
Subject Re: XML binding in the default namespace
Date Thu, 22 May 2008 16:24:58 GMT
Robin,

Sorry not noticing this earlier. You can use default namespaces in the  
document, but not in the binding. The JXPathContext  reqires a prefix.

Regards,
Suzan.

Robin Wyles wrote:
> Hi All,
>
> I'm having trouble binding to a XML document with a declared default 
> namespace on C2.2. I've read back over the many posts on the subject 
> on this list, and have enabled NSPrefixes for the SAXParser as 
> suggested, but am still having problems. Here is the document to which 
> I am binding:
>
> <entry xmlns="http://www.w3.org/2005/Atom">
>     <title>test</title>
> </entry>
>
> ... and the binding file:
>
> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
>     xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>     xmlns="http://www.w3.org/2005/Atom"
>     path="/" >
>     <fb:value id="title" path="title"/>
> </fb:context>
>
> This doesn't seem to work, no value is loaded for the <title/> 
> element. I've also tried the following binding file, which still 
> doesn't work:
>
> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
>     xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>     xmlns:atom="http://www.w3.org/2005/Atom"
>     path="/" >
>     <fb:value id="title" path="atom:title"/>
> </fb:context>
>
> I can get it to work using  the following document and binding file:
>
> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
>     <atom:title>test</atom:title>
> </atom:entry>
>
> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
>     xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
>     path="/" >
>     <fb:value id="title" path="atom:title"/>
> </fb:context>
>
> However, I am not really able to declare the namespace prefixes in the 
> source document like that - they really need to be specified in the 
> defined default namespace. Am I missing something here, or are there 
> really still issues with this?
>
> If anyone could help I'd really appreciate it!
>
> Thanks,
>
> Robin
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message