You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2014/04/29 22:39:15 UTC
[jira] [Resolved] (CONFIGURATION-573) The values of XML
configuration keys having namespace prefix are null
[ https://issues.apache.org/jira/browse/CONFIGURATION-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oliver Heger resolved CONFIGURATION-573.
----------------------------------------
Resolution: Fixed
Fix Version/s: 2.0
Fixed in SVN in revision 1591093.
> The values of XML configuration keys having namespace prefix are null
> ---------------------------------------------------------------------
>
> Key: CONFIGURATION-573
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-573
> Project: Commons Configuration
> Issue Type: Bug
> Components: Expression engine
> Affects Versions: 1.10
> Reporter: Petras
> Fix For: 2.0
>
>
> Consider such snippet:
> {code:java}
> public void testElementWithNameSpace() throws Exception {
> String xml =
> "<Config>\n" +
> "<dsig:Transforms xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\">\n" +
> " <dsig:Transform Algorithm=\"http://www.w3.org/TR/1999/REC-xpath-19991116\">\n" +
> " <dsig:XPath xmlns:ietf=\"http://www.ietf.org\" xmlns:pl=\"http://test.test\">self::pl:policy1</dsig:XPath>\n" +
> " </dsig:Transform>\n" +
> " <dsig:Transform Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\"/>\n" +
> "</dsig:Transforms>" +
> "</Config>";
> final XMLConfiguration config = new XMLConfiguration();
> config.setAttributeSplittingDisabled(true);
> config.setDelimiterParsingDisabled(true);
> config.setExpressionEngine(new XPathExpressionEngine());
> config.load(new StringReader(xml));
> System.out.println(ConfigurationUtils.toString(config));
> }
> {code}
> It prints all keys as null:
> {code}
> dsig:Transforms/dsig:Transform/dsig:XPath=null
> dsig:Transforms/dsig:Transform/dsig:XPath/@xmlns:ietf=null
> dsig:Transforms/dsig:Transform/dsig:XPath/@xmlns:pl=null
> dsig:Transforms/dsig:Transform/@Algorithm=null
> dsig:Transforms/@xmlns:dsig=null
> {code}
> Without XPathExpressionEngine set it prints correct values:
> {code}
> dsig:Transforms.dsig:Transform.dsig:XPath=self::pl:policy1
> dsig:Transforms.dsig:Transform.dsig:XPath[@xmlns:ietf]=http://www.ietf.org
> dsig:Transforms.dsig:Transform.dsig:XPath[@xmlns:pl]=http://test.test
> dsig:Transforms.dsig:Transform[@Algorithm]=[http://www.w3.org/TR/1999/REC-xpath-19991116, http://www.w3.org/TR/2001/REC-xml-c14n-20010315]
> dsig:Transforms[@xmlns:dsig]=http://www.w3.org/2000/09/xmldsig#
> {code}
> JXPath 1.3 version dependecy was used.
> Am I missing something?
--
This message was sent by Atlassian JIRA
(v6.2#6252)