For another question I have created some XML related code that works on my development machine but not on viper codepad where I tested it before adding it to my answer.
I could reduce my problem to the point that the order of nodes returned by DOMXPath::query()
differs between my system and the codepad.
XML: <test>This is some <span>text</span>, fine.</test>
When I query all textnodes //child::text()
the result differs:
Viper Codepad:
#0: This is some
#1: , fine.
#2: text
My Machine:
#0: This is some
#1: text
#2: , fine.
I'm not that experienced with xpath that I do understand why this happens and how it's probably possible to influence the return order with the PHP implementation.
Edit:
Further testing has revealed that LIBXML_VERSION
differs between the two systems:
Viper Codepad: 20626 (2.6.26; 6 Jun 2006)
My Machine...: 20707 (2.7.7; 15 Mar 2010)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…