[jira] [Resolved] (VELTOOLS-188) Velocity XmlTool 3.0 with multiple namespaces does not execute

"Claude Brisson (Jira)" <[email protected]> Thu, 18 Jun 2026 08:50:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/VELTOOLS-188?page=3Dcom.atlass=
ian.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 a=
nd a for author:=C2=A0
> {{<b:book xmlns:b=3D"http://www.test.com/book" xmlns:a=3D"http://www.test=
.com/author" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">}}=C2=
=A0).
> The xml is generated from a JAXB class. In the past I could just address =
this as:
> $book=3D$xmlTool.parse($xmlText).get("b:book")=20
>  $authorName=3D$book.find("./b:author/a:name")
> With the new versions that does not seem to work. The return value from g=
et(...) is always null. It seems, that the XPath is missing the NamespaceCo=
ntext 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 VelocityToo=
ls) 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 tr=
unk of veloctity tools from SVN.=C2=A0I used the code from [https://www.ibm=
.com/developerworks/library/x-nmspccontext/index.html] for the Namespace Ca=
che class.
> =C2=A0



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