Loading ...
Sorry, an error occurred while loading the content.

Re: [xml-doc] Using XPATH starts-with function in ASP

Expand Messages
  • Mark Cho
    Hello All, For those of you following this thread, I found my solution and just wanted to thank everyone for their responses. Before calling XPATH functions
    Message 1 of 5 , Oct 4, 2001
    • 0 Attachment
      Hello All,

      For those of you following this thread, I found my solution and just wanted
      to thank everyone for their responses.

      Before calling XPATH functions from ASP, you have to set the DOMDocument
      object's setProperty method so that it can talk XPATH, as follows (ex for
      VBScript):

      ResultNode.setProperty "SelectionLanguage", "XPath"

      Then, you can use starts-with as follows:

      Set contacts = ResultNode.selectnodes("//Contact[starts-with(@First_Name,'"&
      first & "')]")

      Thanks again for all your help.
      Regards,
      Mark

      ----- Original Message -----
      From: "Mark Cho" <mcho@...>
      To: <xml-doc@yahoogroups.com>
      Sent: Wednesday, October 03, 2001 9:14 AM
      Subject: Re: [xml-doc] Using XPATH starts-with function in ASP


      > I also tried the following to no avail...
      >
      > Set contacts =
      ResultNode.selectnodes("//Contact[starts-with(@First_Name,'"&
      > first & "')]")
      >
      > I'm using MSXML3.0 which should include the starts-with function.
      >
      > I may have to use XSL if there is no work around, but that would involve
      > some significant changes. Please let me know if you can help. Thanks.
      >
      > PS: Giles - I may need you to dig out that XSL you did previously. Thank
      > you!
      >
      > ----- Original Message -----
      > From: "Jirka Kosek" <jirka@...>
      > To: <xml-doc@yahoogroups.com>
      > Sent: Wednesday, October 03, 2001 7:23 AM
      > Subject: Re: [xml-doc] Using XPATH starts-with function in ASP
      >
      >
      > > Giles Hogben wrote:
      > > >
      > > > I had the exact same problem.
      > > > After extensive testing, I came to the conclusion that this is a bug.
      > > > I did find a workaround however, which was to use an xslt stylesheet
      > with
      > > > this bit of XPATH in it and then use ASP to do a transform.
      > >
      > > > > Set contacts =
      > ResultNode.getElementsByTagName("Contact[@First_Name='"&
      > > > first & "']")
      > >
      > > getElementsByTagName is DOM method which can accept only element name or
      > > *. If you want use full flesget XPath expressions, you must use method
      > > selectNodes or selectSingleNodes instead.
      > >
      > > -----------------------------------------------------------------
      > > Jirka Kosek
      > > e-mail: jirka@...
      > > http://www.kosek.cz
      > >
      > > -------------------------------------------------------------------
      > > Post a message: mailto:xml-doc@yahoogroups.com
      > > Unsubscribe: mailto:xml-doc-unsubscribe@yahoogroups.com
      > > Switch to digest: mailto:xml-doc-digest@yahoogroups.com
      > > Put mail on hold: mailto:xml-doc-nomail@yahoogroups.com
      > > Contact adminstrator: mailto:xml-doc-owner@yahoogroups.com
      > > Make changes via Web: http://groups.yahoo.com/subscribe/xml-doc/
      > > Read archived messages: http://groups.yahoo.com/messages/xml-doc/
      > > -------------------------------------------------------------------
      > >
      > > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
      > >
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.