You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robin Wyles <ro...@robinwyles.com> on 2008/05/14 15:38:15 UTC

XML binding in the default namespace

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







Re: XML binding in the default namespace

Posted by Joerg Heinicke <jo...@gmx.de>.
On 21.05.2008 08:04, Suzan Foster wrote:
> https://issues.apache.org/jira/browse/COCOON-1794

But the patch does not change anything for non-repeater bindings. Does 
this imply that binding to default namespace actually works in general, 
the namespaces are just not propagated down to repeater children?

Joerg

> Grzegorz Kossakowski schreef:
>> Suzan Foster pisze:
>>> Grzegorz,
>>>
>>> I didn't mean it as criticism. I understand that Cocoon is a large 
>>> codebase and that there are often more pressing issues. The issue 
>>> comes down to relative JXPathContexts not inheriting the namespace 
>>> declarations. My patches call JXPathBindingBase.applyNSDeclarations  
>>> and JXPathBindingBase.applyLeniency on the result of 
>>> .JXPathContexts.getRelativeContext. Mainly RepeaterJXPathBinding and 
>>> MultiValueJXPathBinding are affected by this issue. Hope this helps.
>>
>> Is there an issue in JIRA with attached patches?

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


Re: XML binding in the default namespace

Posted by Suzan Foster <su...@nerocmediaware.nl>.
https://issues.apache.org/jira/browse/COCOON-1794

Grzegorz Kossakowski schreef:
> Suzan Foster pisze:
>> Grzegorz,
>>
>> I didn't mean it as criticism. I understand that Cocoon is a large 
>> codebase and that there are often more pressing issues. The issue 
>> comes down to relative JXPathContexts not inheriting the namespace 
>> declarations. My patches call JXPathBindingBase.applyNSDeclarations  
>> and JXPathBindingBase.applyLeniency on the result of 
>> .JXPathContexts.getRelativeContext. Mainly RepeaterJXPathBinding and 
>> MultiValueJXPathBinding are affected by this issue. Hope this helps.
>
> Is there an issue in JIRA with attached patches?
>


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


Re: XML binding in the default namespace

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Suzan Foster pisze:
> Grzegorz,
> 
> I didn't mean it as criticism. I understand that Cocoon is a large 
> codebase and that there are often more pressing issues. The issue comes 
> down to relative JXPathContexts not inheriting the namespace 
> declarations. My patches call JXPathBindingBase.applyNSDeclarations  and 
> JXPathBindingBase.applyLeniency on the result of 
> .JXPathContexts.getRelativeContext. Mainly RepeaterJXPathBinding and 
> MultiValueJXPathBinding are affected by this issue. Hope this helps.

Is there an issue in JIRA with attached patches?

-- 
Grzegorz Kossakowski

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


Re: XML binding in the default namespace

Posted by Suzan Foster <su...@nerocmediaware.nl>.
Grzegorz,

I didn't mean it as criticism. I understand that Cocoon is a large 
codebase and that there are often more pressing issues. The issue comes 
down to relative JXPathContexts not inheriting the namespace 
declarations. My patches call JXPathBindingBase.applyNSDeclarations  and 
JXPathBindingBase.applyLeniency on the result of 
.JXPathContexts.getRelativeContext. Mainly RepeaterJXPathBinding and 
MultiValueJXPathBinding are affected by this issue. Hope this helps.

Grzegorz Kossakowski schreef:
> Suzan Foster pisze:
>> I do, but have to maintain my own patches as there is little traction 
>> to get the issues resolved which have been reported in Jira.
>
> Suzan, sometimes gentle reminder helps. Leave a comment on outstanding 
> issues that needs an attention. I may have some free cycles at the end 
> of this week.
>


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


Re: XML binding in the default namespace

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Suzan Foster pisze:
> I do, but have to maintain my own patches as there is little traction to 
> get the issues resolved which have been reported in Jira.

Suzan, sometimes gentle reminder helps. Leave a comment on outstanding issues that needs an 
attention. I may have some free cycles at the end of this week.

-- 
Grzegorz Kossakowski

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


Re: XML binding in the default namespace

Posted by Suzan Foster <su...@nerocmediaware.nl>.
Robin,

I don't have patches for C2.2 as i'm still working with C2.1.8. But you 
can have a look at my altered sources. The issue is caused by 
JXPathContext not inheriting namespaces from their parents.

Robin Wyles schreef:
> Hi Suzan,
>
> Thanks for your reply... Reading over the issues in Jira is seems that 
> enabling NSPrefixes on the SAXParser should fix the problem, and it 
> does to a certain degree... but not in the case of using a default 
> namespace.
>
> Do you have a set of patches against C2.2 that I could try?
>
> Thanks,
>
> Robin
>
>
> On 19 May 2008, at 13:01, Suzan Foster wrote:
>
>> I do, but have to maintain my own patches as there is little traction 
>> to get the issues resolved which have been reported in Jira.
>>
>> Robin Wyles schreef:
>>> Has no one managed to use CForms XML binding with documents that 
>>> declare a default namespace? I can't believe this can be the case!
>>>
>>> If anyone can point me in the right direction I'd appreciate it...
>>>
>>> Thanks,
>>>
>>> Robin
>>>
>>>
>>> On 14 May 2008, at 14:38, 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
>>
>


Re: XML binding in the default namespace

Posted by Robin Wyles <ro...@robinwyles.com>.
Hi Suzan,

Thanks for your reply... Reading over the issues in Jira is seems  
that enabling NSPrefixes on the SAXParser should fix the problem, and  
it does to a certain degree... but not in the case of using a default  
namespace.

Do you have a set of patches against C2.2 that I could try?

Thanks,

Robin


On 19 May 2008, at 13:01, Suzan Foster wrote:

> I do, but have to maintain my own patches as there is little  
> traction to get the issues resolved which have been reported in Jira.
>
> Robin Wyles schreef:
>> Has no one managed to use CForms XML binding with documents that  
>> declare a default namespace? I can't believe this can be the case!
>>
>> If anyone can point me in the right direction I'd appreciate it...
>>
>> Thanks,
>>
>> Robin
>>
>>
>> On 14 May 2008, at 14:38, 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
>


Re: XML binding in the default namespace

Posted by Suzan Foster <su...@nerocmediaware.nl>.
I do, but have to maintain my own patches as there is little traction to 
get the issues resolved which have been reported in Jira.

Robin Wyles schreef:
> Has no one managed to use CForms XML binding with documents that 
> declare a default namespace? I can't believe this can be the case!
>
> If anyone can point me in the right direction I'd appreciate it...
>
> Thanks,
>
> Robin
>
>
> On 14 May 2008, at 14:38, 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


Re: XML binding in the default namespace

Posted by Robin Wyles <ro...@robinwyles.com>.
Has no one managed to use CForms XML binding with documents that  
declare a default namespace? I can't believe this can be the case!

If anyone can point me in the right direction I'd appreciate it...

Thanks,

Robin


On 14 May 2008, at 14:38, 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
>
>
>
>
>
>


Re: XML binding in the default namespace

Posted by Suzan Foster <su...@islief.nl>.
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