Re: [XSLTalk] XPATH + Namespaces

Conor,

Thanks mate,

That is a real saviour.

I can go home now.

Paul



dagda1@hotmail.com





>From: Conor Ryan <cryan@xmlw.ie>
>Reply-To: XSLTalk@yahoogroups.com
>To: XSLTalk@yahoogroups.com
>Subject: Re: [XSLTalk] XPATH + Namespaces
>Date: Tue, 15 Jul 2003 16:27:43 +0100
>
>Hi Paul,
>
>The following should work.
>
>xmlDoc.setProperty "SelectionLanguage", "XPath"
>xmlDoc.setProperty "SelectionNamespaces",
>"xmlns:ar='http://www.govtalk.gov.uk/CM/envelope'
>xmlns:br='http://www.govtalk.gov.uk/gateway/addressrequest'"
>sRURef =
>xmlDoc.selectSingleNode("ar:GovTalkMessage/ar:Body/br:AddressRequest/br:Key[@Type='ruref']").text
>
>GovTalkMessage and all its descendants, except for AddressRequest and its
>descendants, are in the namespace "http://www.govtalk.gov.uk/CM/envelope".
>So to match these elements you must declare the namespace with a prefix and
>use this prefix in the XPath expression. AddressRequest and its descendants
>are in the namespace "http://www.govtalk.gov.uk/gateway/addressrequest" so
>you must declare that as well with its own prefix and use the prefix
>accordingly in the XPath expression. Hence the use of two prefixes, ar: and
>br:, in the XPath expression.
>
>hope this helps.
>
>rgds,
>
>Conor.
>
>At 15:02 15/07/03 +0000, you 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/
>
>---------
>Conor Ryan,
>XML Workshop Ltd,
>10 Greenmount Industrial Estate, Harolds Cross, Dublin 12, IRELAND.
>Email: cryan@xmlw.ie
>Phone: +353 1 449 6250; Fax: +353 1 449 6299
>Web: http://www.xmlw.ie/
>
>

_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today! 
http://www.msn.co.uk/messenger


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/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:55:51 UTC