+ Reply to Thread
Results 1 to 3 of 3

Full xpath support in visual basic?

  1. #1
    Jesper
    Guest

    Full xpath support in visual basic?

    Hi,

    In an excel 2003 VB application I address data using XPath. I'm using
    filters in the XPath expression, however I'm disturbed to see that filters
    only works at last node in an expressions like

    "/root/foo/bar[@no='5']"

    and do not work in this expression

    "/root/foo[@no='5']/bar"

    Some of my code looks like this:

    Set xp = ActiveSheet.Range("j32").XPath
    xp.SetValue ActiveWorkbook.XmlMaps(mymapname),
    "/pipe-int/pipe_design/cross_sectional_design/layers/layer[@no='14']/outer_diameter"

    Is it correct that filters are only supported at last node, I really can't
    imagine this but I've tried different setups that support this question. Am I
    missing some dll's or do you have any idea of what could be wrong?



  2. #2
    NickHK
    Guest

    Re: Full xpath support in visual basic?

    Jesper,
    Not that I know anything about XPath, but:
    http://msdn.microsoft.com/library/en...03XMLIntro.asp
    <Quote>
    An optional filter can be expressed at the end of the xpath.
    Example: "/ns1:root/ns1:row/ns1:column1[@foo='abc']" is supported but not
    "/ns1:root/ns1:row[@foo='abc']/ns1:column1"
    </Quote>

    NickHK

    "Jesper" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > In an excel 2003 VB application I address data using XPath. I'm using
    > filters in the XPath expression, however I'm disturbed to see that filters
    > only works at last node in an expressions like
    >
    > "/root/foo/bar[@no='5']"
    >
    > and do not work in this expression
    >
    > "/root/foo[@no='5']/bar"
    >
    > Some of my code looks like this:
    >
    > Set xp = ActiveSheet.Range("j32").XPath
    > xp.SetValue ActiveWorkbook.XmlMaps(mymapname),
    >

    "/pipe-int/pipe_design/cross_sectional_design/layers/layer[@no='14']/outer_d
    iameter"
    >
    > Is it correct that filters are only supported at last node, I really can't
    > imagine this but I've tried different setups that support this question.

    Am I
    > missing some dll's or do you have any idea of what could be wrong?
    >
    >




  3. #3
    Jesper
    Guest

    Re: Full xpath support in visual basic?

    Thank you Nick,

    Does anyone know why MS has chosen this stripped down xpath parser?

    regard Jesper.

    "NickHK" wrote:

    > Jesper,
    > Not that I know anything about XPath, but:
    > http://msdn.microsoft.com/library/en...03XMLIntro.asp
    > <Quote>
    > An optional filter can be expressed at the end of the xpath.
    > Example: "/ns1:root/ns1:row/ns1:column1[@foo='abc']" is supported but not
    > "/ns1:root/ns1:row[@foo='abc']/ns1:column1"
    > </Quote>
    >
    > NickHK
    >
    > "Jesper" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > In an excel 2003 VB application I address data using XPath. I'm using
    > > filters in the XPath expression, however I'm disturbed to see that filters
    > > only works at last node in an expressions like
    > >
    > > "/root/foo/bar[@no='5']"
    > >
    > > and do not work in this expression
    > >
    > > "/root/foo[@no='5']/bar"
    > >
    > > Some of my code looks like this:
    > >
    > > Set xp = ActiveSheet.Range("j32").XPath
    > > xp.SetValue ActiveWorkbook.XmlMaps(mymapname),
    > >

    > "/pipe-int/pipe_design/cross_sectional_design/layers/layer[@no='14']/outer_d
    > iameter"
    > >
    > > Is it correct that filters are only supported at last node, I really can't
    > > imagine this but I've tried different setups that support this question.

    > Am I
    > > missing some dll's or do you have any idea of what could be wrong?
    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1