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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to