Expression with attributes - InfoPath Dev
in

InfoPath Dev

Expression with attributes

Last post 01-27-2006 09:30 AM by Matt Faus. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-27-2006 03:58 AM

    Expression with attributes

    Hi all, in a dropdownlist to filter duplicate values I used
    not(my:RepElem1 = preceding::my:RepElem1)


    and it works fine. Now Node1 became an attribute. I tried to write:
    not(@my:RepElem1 = preceding::@my:RepElem1)


    but this expression is not accepted.
    So I tried:
    not(../my:Parent/@my:RepElem1 = ../preceding::my:Parent/@my:RepElem1)


    but it doesn't filter anything.
    Does it happen becouse "preceeding" is not available for attributes?How can I sort my ddl?Any suggestions?

    Thank u.


  • 01-27-2006 06:31 AM In reply to

    Re: Expression with attributes

    *editted to clear confusion*

    not(. = preceding::my:NameOfElement/@my:NameOfAttribute)

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-27-2006 06:41 AM In reply to

    Re: Expression with attributes

    That's not a correct XPath string, Matt :(
  • 01-27-2006 08:54 AM In reply to

    Re: Expression with attributes

    Marco,

    Sorry for the mistake, but I did some experimenting in InfoPath and got the following XPath to work:

    not(. = preceding::my:NameOfElement/@my:NameOfAttribute)

    You are doing this via the 'Filter Data' and evaluating 'The Expression', correct? I just setup a sample form using the above XPath and it populated my drop-down list with unique attributes of a repeating element.

    I hope this helps!

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-27-2006 08:55 AM In reply to

    Re: Expression with attributes

    Hi Matt,
    it doesn't work. I read that in the result os preceding there are no attributes, but only elements.
    I think that this line is correct:
    not(../my:Parent/@my:RepElem1=../preceding::my:Parent/@my:RepElem1)

    but proceding doesn't include the attribute nodes. Please, any help is welcomed :) Thank u.
  • 01-27-2006 09:30 AM In reply to

    Re: Expression with attributes

    Weird, I found the same thing athttp://www.w3.org/TR/xpath

    quote:
    the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes

    But, I did get a sample form running. If you e-mail me your e-mail address (it hides it on the forum), I can e-mail this sample form to you.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.