- From: Paul Cowan <dagda1@hotmail.com>
- Date: Tue, 15 Jul 2003 15:24:15 +0000
- To: XSLTalk@yahoogroups.com
Emanuil, I have resolved the toplevel namespace with help from the following article http://support.microsoft.com/default.aspx?scid=kb;en-us;313372, I used the code: sNameSpaces = "xmlns:cm='http://www.govtalk.gov.uk/CM/envelope'" oDOM.setProperty "SelectionNamespaces", sNameSpaces Then the following XPath works, (if I take the namespace out of the <AddressRequest> tag): sRURef = oDOM.selectSingleNode("cm:GovTalkMessage/cm:Body/cm:AddressRequest/cm:Key[@Type='ruref']").text The problem is that the <AddressRequest> tag also has a default namespace and is declared like so: <AddressRequest xmlns:="http://www.govtalk.gov.uk/gateway/addressrequest"> How do I declare this namespace and then use XPath to access it: Thanks Paul dagda1@hotmail.com >From: "Emmanuil Batsis (Manos)" <mbatsis@netsmart.gr> >Reply-To: XSLTalk@yahoogroups.com >To: XSLTalk@yahoogroups.com >Subject: Re: [XSLTalk] XPATH + Namespaces >Date: Tue, 15 Jul 2003 18:22:35 +0300 > >I think that is a bug with msxml try declaring the namespace with >setProperty "namespaces" etc as (note the ':') > >xmlns:="http://www.govtalk.gov.uk/CM/envelope" > >there was recent related discussions recently... > > > > >Paul Cowan wrote: > > > Emanuil et all, > > > > Your XPath now works if I take the namespace out of the <AddressRequest> > > tag, how do I declare this local default namespace with respect to the >DOM?? > > > > To Refresh, the XML is: > > > > <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> > > > > > > Thanks > > > > Paul > > > > > > > > dagda1@hotmail.com > > > > > > > > > > > > > >>From: "Emmanuil Batsis (Manos)" <mbatsis@netsmart.gr> > >>Reply-To: XSLTalk@yahoogroups.com > >>To: XSLTalk@yahoogroups.com > >>Subject: Re: [XSLTalk] XPATH + Namespaces > >>Date: Tue, 15 Jul 2003 17:55:05 +0300 > >> > >> > >> > >>Paul Cowan wrote: > >> > >> > >>sRURef=oDOM.selectSingleNode("ar:GovTalkMessage/Body/AddressRequest/Key[@Type='ruref']").text > >> > >>that should be > >> > >>sRURef=oDOM.selectSingleNode("ar:GovTalkMessage/ar:Body/ar:AddressRequest/ar:Key[@Type='ruref']").text > >> > >> > >> > >>-- > >>Manos Batsis > >> > >>Netsmart S.A. > >> > >>Snail mail: > >>Panepistimiou 58, > >>10678, Athens, Hellas > >> > >>URL: http://www.netsmart.gr > >>Email: mbatsis at netsmart dot gr > >>Tel: (+30) 210 33 02 608 > >>Fax: (+30) 210 33 02 658 > >>FOAF: http://forte.netsmart.gr/foaf/manos_foaf.rdf > >> > >> > >> > >> > > > > > > _________________________________________________________________ > > Tired of 56k? Get a FREE BT Broadband connection > > http://www.msn.co.uk/specials/btbroadband > > > > > > > > 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/ > > > > > > > >-- >Manos Batsis > >Netsmart S.A. > >Snail mail: >Panepistimiou 58, >10678, Athens, Hellas > >URL: http://www.netsmart.gr >Email: mbatsis at netsmart dot gr >Tel: (+30) 210 33 02 608 >Fax: (+30) 210 33 02 658 >FOAF: http://forte.netsmart.gr/foaf/manos_foaf.rdf > > > > _________________________________________________________________ Sign-up for a FREE BT Broadband connection today! http://www.msn.co.uk/specials/btbroadband ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Naturally Painless & Spray Away Backaches & Joint Pain. $19.97 http://www.challengerone.com/t/l.asp?cid=2867&lp=m331.html http://us.click.yahoo.com/tJIe0D/79VGAA/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 11:24:24 UTC