- From: Paul Cowan <dagda1@hotmail.com>
- Date: Tue, 15 Jul 2003 13:36:02 +0000
- To: XSLTalk@yahoogroups.com
All, I have an Xpath problem which I had cured but unfortunately the namespaces have changed and my Xpath no longer works. I have the following XML: <GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope"> <EnvelopeVersion>1.0</EnvelopeVersion> <Header> <MessageDetails> <Class>ADM-address-request</Class> <Qualifier>request</Qualifier> <TransactionID>L9MLHH1FB25F</TransactionID> <CorrelationID>296</CorrelationID> <GatewayTimestamp>2003-07-15T14:00:04</GatewayTimestamp> </MessageDetails> </Header> <Body> <AddressRequest xmlns="http://www.govtalk.gov.uk/gateway/addressrequest"> <ServiceName>QES-ORG</ServiceName> <Key Type="ruref">49900011596T</Key> </AddressRequest> </Body> </GovTalkMessage> I want to say: sRURef=oDOM.selectSingleNode("GovTalkMessage/Body/AddressRequest/Key[@Type='ruref']").text This works fine when I remove the Namespaces. But obviously in a real world scenario this is not applicable. I went through this before and it was something to do with the default namespace and MSXML4. I have added the following code: sNameSpaces = "xmlns:ar='http://www.govtalk.gov.uk/CM/envelope'" oDOM.setProperty "SelectionNamespaces", sNameSpaces and then try and use xpath like so sRURef=oDOM.selectSingleNode("ar:GovTalkMessage/Body/AddressRequest/Key[@Type='ruref']").text but still I get the same error. Can anyone help me out. Also what do I do about the locally declared namespace on the <AddressRequest> tag. Any help at all greatly appreciated. Paul dagda1@hotmail.com _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/sOykFB/k9VGAA/ySSFAA/2U_rlB/TM ---------------------------------------------------------------------~-> This discussion list is hosted at TopXML (topxml.com). If you like what we're doing, please show your support by posting your small code snippets there! Also, post your tech announcements and news on our new site, Markup World (markupworld.com) To unsubscribe from this group, send an email to: XSLTalk-unsubscribe@egroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Received on Tuesday, 15 July 2003 09:40:10 UTC