RE: Using position predicate in XPath string within s
Last post on this subject which may not interrest everybody on the list since it's not a pure xsl problem but more DOM and manipulation of XML files. So I've learnt the reason why Xpath expression is not always understood within selectSingleNode DOM Method. Just because, despite the msdn spec I found (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm l/xmmthselectsinglenode.asp) describing this method, the language supported is not Xpath by default, but rather a strange "XSLPattern" (the default language obviously depends on the parser progID). To be sure Xpath querys are understood, we must specifie it : ObjXML.setProperty "SelectionLanguage", "XPath" That's all subject closed ! Matthieu. -----Message d'origine----- De : Matthieu Ricaud [mailto:matthieu.ricaud@xxxxxxx] Envoyi : jeudi 25 novembre 2004 10:54 @ : xsl-list@xxxxxxxxxxxxxxxxxxxxxx Objet : RE: Using position predicate in XPath string within selectSingleNode DOM method Hi Pieter, Thanks a lot for your proposition of finding a solution together to my problem. At the moment I was going to tell you what ITEM return, I noticed it returns the SECOND <ITEM> node and not the FIRST ! And actually this is the solution of my problem ! With SelectSingleNode Method the Xpath position indice starts at 0 and not 1 like in XSL's Xpath query. That means for example : SelectSingleNode("/FORMATION/EPREUVES/EPREUVEAOPT/OPTION") select the same node as : <xsl:for-each select="/FORMATION/EPREUVES/EPREUVEAOPT/OPTION"> Everything's ok now ! exept that I'm really angry with Microsoft which did not specify this in the msdn ! But anyway, that's great !! thanks all for helping ! Matt
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format