[erlang-questions] xmerl_xpath doesn't handle "//@*" correctly?

Matthew Dempsky <>
Tue Aug 12 00:23:14 CEST 2008


I have almost zero xpath knowledge, but this seems inconsistent to me:

1> F = fun(S) -> {Doc, _} = xmerl_scan:string(S),
length(xmerl_xpath:string("//@*", Doc)) end.
#Fun<erl_eval.6.13229925>
2> F("<a b='c'></a>").
1
3> F("<a b='c'><d/></a>").
1
4> F("<a b='c'> </a>").
0

Shouldn't "//@*" return 1 attribute for the last case as well?  (Using
"//*/@*" instead works in all three cases as I expect.)



More information about the erlang-questions mailing list