Graphics

 View Only
  • 1.  Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-29-2020 22:17

    Using Xpression v9.5 build 4978.

    im working using an RSS/HTTP Datalinq source that is delivered in an xml format from the server.

    currently we have a search like this:

    Animals\Animal<Color=@color@>\Name

    but i would like to search like this:

    Animals\Animal<Color= @color@ && Fur= @Fur Type@>\Name

    ive tried looking through the documentation and forums and i cant figure out if this is possible. im seeing conflicting comments about xpath support, and i havent been able to use regular xpath searches within it. so it would be super helpful if someone could also link me the to any documentation about this subject.



  • 2.  RE: Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-29-2020 22:36

    I believe back in version 7 I asked this question and got the answer that it doesn't, nor have I ever gotten it to work. I don't have a reason to believe that has changed. But you can use multiple datalinq keys within the same source. So if you have the capability to restructure your XML schema, you could have it work something like this:

    Animals\Animal<Color=@color@>\Animal<Fur=@Fur@>Name

    Problem with this of course is that it only works when you have unique attributes to search, so two animals with the same color as their attribute would cause problems.

    There IS an xpDatainq object that exists within the scripting API, so it's possible that you could use scripting to resolve your conditional before passing the value into the datalinq entry you actually want to fetch. But I've never done any extensive testing with it.


    #XPression


  • 3.  RE: Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-29-2020 23:18

    i see thats a bummer. do you know if its possible to search children instead? like so:

    Animals\Animal<Fur.Type = curly>\Name


    #XPression


  • 4.  RE: Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-30-2020 15:25

    You can have it search multiple fields; you just need to semicolon separate them like this:

    Animals\Animal<Color=@color@;Fur=@Fur Type@>\Name

     

    You can also search children elements/attributes with the Dot syntax, so you example of Fur.Type should work:

    Animals\Animal<Fur.Type=curly>\Name


    #XPression


  • 5.  RE: Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-30-2020 15:33

    Hi Martin,

    We apologize for any incorrect info you received.  This feature was introduced in version 6.7:

    version 6.7 build 3747 (January 27th 2017)

    ⦁ [implemented] the XML/JSON datalinqs can now search multiple attributes or elements to return a node that matches all search criteria. e.g. players<team=NY;jersey=10>

     

    This feature may come in handy too; if your search returns multiple results, you can use an index to choose which of the results to use:

    ⦁ [implemented] a DataLinq comparison key such as <club=ross> can now have an additional index parameter as well, like so <club=ross<2>>, which will retrieve the second item matching the key.

    and here is info on searching child elements:

    ⦁ [implemented] the XML datalinq types can search for children elements/attributes in a level of the tree by using "childname.field=%key%". e.g. player<info.jersey=%num%>\name

     


    #XPression


  • 6.  RE: Is it possible to have multiple/conditional Datalinq Keys and Macros?

    Posted 09-30-2020 18:33

    No problem Brian, it's entirely possible I asked this question back in 2016 (I remember it having to do with how we were structuring election data) prior to 6.7 being released! We haven't had a need to use this feature but it's good to know it does exist!


    #XPression