[ 
https://issues.apache.org/jira/browse/VELTOOLS-188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claude Brisson resolved VELTOOLS-188.
-------------------------------------
    Fix Version/s: 3.2
                   4.0
         Assignee: Claude Brisson
       Resolution: Fixed

> Velocity XmlTool 3.0 with multiple namespaces does not execute
> --------------------------------------------------------------
>
>                 Key: VELTOOLS-188
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-188
>             Project: Velocity Tools
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Jens Popp
>            Assignee: Claude Brisson
>            Priority: Major
>             Fix For: 3.2, 4.0
>
>         Attachments: patch.txt
>
>
> I'm processing a XML file with multiple Namespaces (lets say b for book and a 
> for author: 
> {{<b:book xmlns:b="http://www.test.com/book"; 
> xmlns:a="http://www.test.com/author"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>}} ).
> The xml is generated from a JAXB class. In the past I could just address this 
> as:
> $book=$xmlTool.parse($xmlText).get("b:book") 
>  $authorName=$book.find("./b:author/a:name")
> With the new versions that does not seem to work. The return value from 
> get(...) is always null. It seems, that the XPath is missing the 
> NamespaceContext from the parsed file. If I modify XPath expression in find 
> to search e.g. for local name or if I "inject" (by replacing some code in 
> VelocityTools) the Namespace it works. It also works with old Dom4j/jaxen 
> combination in VelocityTools 2.0.
> I attached a Quick & Dirty Patch that works for me. It is based on the trunk 
> of veloctity tools from SVN. I used the code from 
> [https://www.ibm.com/developerworks/library/x-nmspccontext/index.html] for 
> the Namespace Cache class.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to