Hunsu / xml-matchers

Automatically exported from code.google.com/p/xml-matchers
0 stars 0 forks source link

XpathReturnType missing for NodeList #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I need an XpathReturnType for xpath expressions that match a node list:

public static XpathReturnType<NodeList> returningAnXmlNodeList() {
      return new XpathReturnType<NodeList>() {
              @Override
              QName evaluationMode() {
                      return XPathConstants.NODESET;
              }};
   }

Original issue reported on code.google.com by flamingp...@gmail.com on 27 Oct 2011 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by david.eh...@gmail.com on 17 Feb 2013 at 6:45

GoogleCodeExporter commented 9 years ago
Can you provide an example of how you would use the NodeSet that would be 
returned?  I'm looking for good examples that will help drive tests and any 
potentially design changes so that this can be useful.

Original comment by david.eh...@gmail.com on 17 Feb 2013 at 10:53

GoogleCodeExporter commented 9 years ago
Unfortunately I am not in the same Job now, I can't remember or imagine quite 
what prompted this issue and I no longer have access to the code base. I do 
recall that I ended up creating a local fork with this change in it. 

I suspect that I wrote some other matchers that can do things on NodeList, for 
example how may entries it has or something...

Original comment by flamingp...@gmail.com on 17 Feb 2013 at 11:52

GoogleCodeExporter commented 9 years ago
No problem.  Thanks for getting back to me anyways.

I was just curious because, like you mention, dealing with a NodeList probably 
requires an entire new set of matchers.  This is similar to Node.  I was having 
a hard time coming up with something usable with the Node return type and ended 
up returning a Source when the XPathReturnType is Node.  See 
http://code.google.com/p/xml-matchers/source/browse/tags/xml-matchers-1.0-RC1/sr
c/main/java/org/xmlmatchers/xpath/XpathReturnType.java#50   

I'm not sure if that is the best thing to do or not, given that I'm unsure of 
how people might want to use it.  I found that I like the way I implemented it 
but I'm only one use case.

Original comment by david.eh...@gmail.com on 18 Feb 2013 at 2:20