more explained

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

to avoid further misunderstandings, I'm posting a more explained report of
my problem.

Meanwhile I found several sources, stating or not stating that this is a
bug.

MS explains (year 2000) why every selection, even on reversed axes, is in
document order (as long as not being indexed by number), not as the spec
would say, in reversed order to remain XSLT compatibility:
http://groups.google.de/group/microsoft.public.xml.msxml-webrelease/browse_thread/thread/9bbaf5203c974d81/05ef623d54e54ff2?lnk=st&q=msxml+reverse+axis+bug&rnum=4&hl=de#05ef623d54e54ff2

MS confirms the very same thing as a bug (in 2002):
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q291193 and assures
to have it fixed with MSXML 3+.

There is no further mention of this kind of problem except here
(http://ewbi.blogs.com/develops/2004/12/net_xsltxpath_b.html) with .net.

So I'm confused, as are some other people which experienced the same prob
are.
Thing is, that the .net implementation must not behave totally different
from other implementations and especially not different to the spec.
If this order is always reversed (resp. in document order), the reversed
axes would have absolutely no sense except for direct number indexing.

"//third/preceding-sibling::*[1]" will not return the same as
"//third/(preceding-sibling::*)[1]" and also not the same as
but "//third/preceding-sibling::*[anyDynExpr]"
seems to equal "//third/(preceding-sibling::*)[anyDynExpr]"

All I wanted to know is: how am I supposed to code this case, since I cannot
figure another way except evaluating every step programatically on client
side:

<root attrib="testroot">
<first attrib="testfirst">
<second attrib="testsecond">
<third attrib="" />
</second>
<fourth />
</first>
</root>

Task: Get the element having a value in the attribute attrib.
Prefered Solution:
return thirdElement.SelectSingleNode("ancestor-or-self::*[string(@attrib) !=
'']");

Problem:
One would suppose this walks up the hierarchy from third over second over
first to root, but the reverse is the case, it always finds root in the very
first place. So there is no sense of having those axes, except for the
rather dump (staticly known) case you want to select
"ancestor-or-self::[x]", where x is a fixed number or special node position
function. For all other cases the term is taken as an array (instead of
straight-forward processing as xpathnavigator-implementations would let
assume, processed in document order, whether or not it is parenthesised or
not. I would understand, if "(ancestor-or-self::*)[string(@attrib) != '']"
returned elements in the document order and in the case without brackets it
would use the contextual direction.

Whether or not this is a bug I don't have the time left to argument. This
has already taken me hours. If noone is interested in this I won't mind.
I simply wanted to report this inadequacy in case some other folks might
suffer or noone ever recognized this behaviour but counts on the behaviour
like I'd understand it. Still I have to find some preferably efficient
solution to get what I need using the f****** .net implementation of xpath.

If I got something wrong or my english is not understandable this might be
due to the fact its nearly 5AM here in germany meantime.

Can someone from MS please state whether this behaviour is at least known /
is different to other implementations / is logical and no compromise / is a
bug or is being fixed or has already been fixed and just revived or whatever
one could do here?

Thanks in advance,
Matt


.



Relevant Pages

  • Re: reversing the comparison
    ... or have any concept of a boolean value. ... That mades these types of comparisons ... and the reverse test was to prevent the old bug ...
    (microsoft.public.vb.general.discussion)
  • [Dapper] [bug] fr_FR locale dependant segfault BUG of dd
    ... Where should I report this if it is realy a bug? ... Bug candidate: ... Reverse Provides: ... Campagne du ruban texte brut contre les courriels en HTML, ...
    (Ubuntu)
  • Re: Problems after updating Net::SSH:Perl
    ... Martin Kissner wrote in ... something between 1.28 and 1.29 reintroduced the bug. ... ones who cared fixes in that version, and the "blocking" bug did not ... (reverse each component and remove .invalid for email address) ...
    (comp.lang.perl.misc)
  • Re: How to substitute "@" for "@" in a string?
    ... the bug in your system. ... (reverse each component and remove .invalid for email address) ... comp.lang.perl.misc guidelines on the WWW: ...
    (comp.lang.perl.misc)
  • Re: a goto command???
    ... And, GOD FORBID, it occasionally has a bug in ... your code never has a bug in it.) ... Reverse name to reply ... Prev by Date: ...
    (comp.soft-sys.matlab)