-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support prefixed names in patterns #115
base: master
Are you sure you want to change the base?
Conversation
re-add PatternParserTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern package is not very well documented, designed, or supported. If not for backwards compatibility, I would have deleted it long ago. I'll look at this, but it's unlikely this is the only change you'll need here. You might be better served by forking this. I'm not sure the existing design, API, and codebase is fixable or maintainable.
Are there plans to replace the |
There are no such plans. I was planning on deleting it eventually. It has no tests currently, and you're the first person I've ever heard from whose using it. |
@@ -0,0 +1,77 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed
* | ||
* ==================================================================== | ||
* | ||
* Copyright 2000-2002 bob mcwhirter & James Strachan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021 The Jaxen Project
* individuals on behalf of the Jaxen Project and was originally | ||
* created by bob mcwhirter <[email protected]> and | ||
* James Strachan <[email protected]>. For more information on the | ||
* Jaxen Project, please see <http://www.jaxen.org/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* James Strachan <[email protected]>. For more information on the | ||
* Jaxen Project, please see <http://www.jaxen.org/>. | ||
* | ||
* $Id$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
* | ||
* @author Claude Mamo | ||
*/ | ||
public class NameNamespaceCompositeTest extends NodeTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QualifiedNameTest or perhaps PrefixedNameTest
|
||
public String getText() | ||
{ | ||
return namespaceTest.getText() + nameTest.getText(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a separator here?
@OverRide
path.setNodeTest( new NameTest( localName, nodeType ) ); | ||
// XXXX: should support namespace in the test too | ||
NameTest nameTest = new NameTest( localName, nodeType ); | ||
NodeTest nodeTest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be a little clearer if you pushed this into the if-block and called setNodeTest from within each branch.
* | ||
* ==================================================================== | ||
* | ||
* Copyright 2000-2002 bob mcwhirter & James Strachan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
"+" | ||
}; | ||
|
||
public PatternParserTest(String name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
XPathFunctionContext.getInstance(), | ||
new SimpleVariableContext(), | ||
new DocumentNavigator()); | ||
assertTrue(pattern.matches(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break this statement up with some local variables for clarity
re-add PatternParserTest