Issue with attribute::
---------------------- Key: JXPATH-115 URL: https://issues.apache.org/jira/browse/JXPATH-115 Project: Commons JXPath Issue Type: Bug Reporter: Michele Vivoda Priority: Minor Checking test (Issue172_CountAttributeNode) I came with the following fix for the code in AttributeContext line 72 from ----- if (!(nodeTest instanceof NodeNameTest)) { return false; } QName name = ((NodeNameTest) nodeTest).getNodeName(); ------ ' to --- (outside method) private static final QName WILDCARD = new QName("", "*"); --- (in method) final QName name ; if (nodeTest instanceof NodeTypeTest) { if (((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE) name = WILDCARD; else return false; } else if (nodeTest instanceof NodeNameTest) { name = ((NodeNameTest) nodeTest).getNodeName(); } else { return false; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/JXPATH-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554349 ] Michele Vivoda commented on JXPATH-115: --------------------------------------- Test case: xpath //attribute::node() xml <xml foo='bar'/> > Issue with attribute:: > ---------------------- > > Key: JXPATH-115 > URL: https://issues.apache.org/jira/browse/JXPATH-115 > Project: Commons JXPath > Issue Type: Bug > Reporter: Michele Vivoda > Priority: Minor > > Checking test (Issue172_CountAttributeNode) I came with the following fix for the code in AttributeContext line 72 > from > ----- > if (!(nodeTest instanceof NodeNameTest)) { > return false; > } > QName name = ((NodeNameTest) nodeTest).getNodeName(); > > ------ > ' > to > --- (outside method) > private static final QName WILDCARD = new QName("", "*"); > --- (in method) > > final QName name ; > if (nodeTest instanceof NodeTypeTest) > { > if (((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE) > name = WILDCARD; > else return false; > } > else if (nodeTest instanceof NodeNameTest) { > name = ((NodeNameTest) nodeTest).getNodeName(); > } > else > { > return false; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by JIRA jira@apache.org
[ https://issues.apache.org/jira/browse/JXPATH-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matt Benson resolved JXPATH-115. -------------------------------- Resolution: Fixed Fix Version/s: 1.3 committed a similar change; rev 617942. > Issue with attribute:: > ---------------------- > > Key: JXPATH-115 > URL: https://issues.apache.org/jira/browse/JXPATH-115 > Project: Commons JXPath > Issue Type: Bug > Reporter: Michele Vivoda > Priority: Minor > Fix For: 1.3 > > > Checking test (Issue172_CountAttributeNode) I came with the following fix for the code in AttributeContext line 72 > from > ----- > if (!(nodeTest instanceof NodeNameTest)) { > return false; > } > QName name = ((NodeNameTest) nodeTest).getNodeName(); > > ------ > ' > to > --- (outside method) > private static final QName WILDCARD = new QName("", "*"); > --- (in method) > > final QName name ; > if (nodeTest instanceof NodeTypeTest) > { > if (((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE) > name = WILDCARD; > else return false; > } > else if (nodeTest instanceof NodeNameTest) { > name = ((NodeNameTest) nodeTest).getNodeName(); > } > else > { > return false; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by JIRA jira@apache.org
[ https://issues.apache.org/jira/browse/JXPATH-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565142#action_12565142 ] Matt Benson commented on JXPATH-115: ------------------------------------ Plus even a bit more similar in rev 617943. ;) > Issue with attribute:: > ---------------------- > > Key: JXPATH-115 > URL: https://issues.apache.org/jira/browse/JXPATH-115 > Project: Commons JXPath > Issue Type: Bug > Reporter: Michele Vivoda > Priority: Minor > Fix For: 1.3 > > > Checking test (Issue172_CountAttributeNode) I came with the following fix for the code in AttributeContext line 72 > from > ----- > if (!(nodeTest instanceof NodeNameTest)) { > return false; > } > QName name = ((NodeNameTest) nodeTest).getNodeName(); > > ------ > ' > to > --- (outside method) > private static final QName WILDCARD = new QName("", "*"); > --- (in method) > > final QName name ; > if (nodeTest instanceof NodeTypeTest) > { > if (((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE) > name = WILDCARD; > else return false; > } > else if (nodeTest instanceof NodeNameTest) { > name = ((NodeNameTest) nodeTest).getNodeName(); > } > else > { > return false; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |