Skip to content

Conversation

@WulfB
Copy link

@WulfB WulfB commented Jun 22, 2015

No description provided.

WulfB added 3 commits June 22, 2015 15:10
node() shouldn't match attributes, see  http://www.w3.org/TR/xpath/
"/node()" should match text and elements (and comments and processing
instructions)
"/descendant-or-self::node()" and /descendant-or-self::node()/ added
added: testNode, testDescendantNode, testDescendantOrSelfNode,
testDescendantOrSelfElement
@chrismattmann
Copy link
Contributor

Hi @WulfB can you suggest what this PR addresses? What problem does it address?

@WulfB
Copy link
Author

WulfB commented Jun 26, 2015

Hi Chris, yes of course:

following the w3c spec the xpath node test ./node() should matches all contained nodes (types) but not attributes since attributes are no children. (=> Changes in NodeMatcher)

So "/node()" returns a superset of "/*". In XPathParser the latter lead to the construction of "ChildMatcher(parse(xpath.substring(2)));" but the first simply returned a "NodeMatcher.INSTANCE" what is wrong i.m.o.

@chrismattmann
Copy link
Contributor

Got it. Would you be willing to file a tika jira issue to go with this request?

@asfgit asfgit closed this in 2e5c7d0 Jun 29, 2015
@chrismattmann
Copy link
Contributor

hi @WulfB - I think this broke the build, can you see: https://builds.apache.org/job/tika-trunk-jdk1.7/771/ and take a look at the now failing tests?

@chrismattmann
Copy link
Contributor

For now, I've rolled it back until we figure it out:

[chipotle:~/tmp/tika1.10] mattmann% svn commit -m "Rollback r1688087 as it seems to cause some tests to fail."
Sending        CHANGES.txt
Sending        tika-core/src/main/java/org/apache/tika/sax/xpath/NodeMatcher.java
Sending        tika-core/src/main/java/org/apache/tika/sax/xpath/XPathParser.java
Sending        tika-core/src/test/java/org/apache/tika/sax/xpath/XPathParserTest.java
Transmitting file data ....
Committed revision 1688239.
[chipotle:~/tmp/tika1.10] mattmann% 

@WulfB
Copy link
Author

WulfB commented Jun 29, 2015

Hi Chris, I’ll try to have a look on it tomorrow morning. See you, Wulf.

Von: Chris Mattmann [mailto:notifications@github.com]
Gesendet: Montag, 29. Juni 2015 16:09
An: apache/tika
Cc: Wulf Berschin
Betreff: Re: [tika] Changed matching of node(), support for descendant-or-self (#52)

hi @WulfBhttps://github.com/WulfB - I think this broke the build, can you see: https://builds.apache.org/job/tika-trunk-jdk1.7/771/ and take a look at the now failing tests?


Reply to this email directly or view it on GitHubhttps://github.com//pull/52#issuecomment-116682723.

tballison pushed a commit to tballison/tika that referenced this pull request Feb 26, 2016
…d nodes contributed by WulfB <wulf.berschin@inacta.ch> this closes apache#52

git-svn-id: https://svn.apache.org/repos/asf/tika/trunk@1688087 13f79535-47bb-0310-9956-ffa450edef68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants