[ 
http://issues.apache.org/jira/browse/COCOON-1671?page=comments#action_12357758 
] 

Michael Schlotfeldt commented on COCOON-1671:
---------------------------------------------

The issue is in JXPathBindingManager around line 122. 
We make call to:
   Document doc = DomHelper.parse(is, this.manager);

The mehod "parse" of DomHelper does sax parsing without the feature 
"http://xml.org/sax/features/namespace-prefixes"; set to true (default is 
false). Details about this can be found at:    
   
http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description

But because I have very limited experience with SAX and even less with SAX 
parsing with excalibur.

The following gets the results we want though (but does not use excalibur):

        InputSource inputSource = new 
InputSource(bindingSource.getInputStream());
                
        DOMBuilder builder = new DOMBuilder();
        ContentHandler locationHandler = new LocationAttributes.Pipe(builder);

        XMLReader xmlReader = 
org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
        xmlReader.setFeature( "http://xml.org/sax/features/namespace-prefixes";, 
true );
        xmlReader.setContentHandler(locationHandler);
        
        xmlReader.parse( inputSource );
        System.out.println(
                "Test of found NS declarations:  " +
                DomHelper.getInheritedNSDeclarations(  
builder.getDocument().getDocumentElement() )
        );

> Form not binding when prefix in binding definition is unequal to that in the 
> instance data for the same namespace.
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1671
>          URL: http://issues.apache.org/jira/browse/COCOON-1671
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8-dev (Current SVN)
>     Reporter: Suzan Foster
>     Assignee: Cocoon Developers Team
>  Attachments: JXPathTest.java, form2_bind_xml1.xml, form2_bind_xml2.xml, 
> form2_bind_xml3.xml, form2_data.xml
>
> In the situation where the binding definition and the instance data share the 
> same namespace uri but have different namespace prefixes the binding will 
> fail. However, when the binding definition and the instance data share the 
> same namespace prefix but not the same namespace uri the binding will be 
> successful. This is incorrect as it shound match on the namespace uri's and 
> not on the prefixes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to