Graphics

 View Only
  • 1.  XML datalinq

    Posted 05-11-2017 04:03

    I'm having trouble with a particular xml file. Now this particular file will be updated externally every minute or so throughout the game, so I'm trying to avoid any conversion through excel, and just work directly with the xml file.

    So the format seems to be a bit inconvenient, the jersey number doesn't match the record number. (Meaning I can't use a datalinq key to fetch the player number. At least not directly.) The player info is stored as so:

    <FootbalLeaguePlayer FirstName="John" LastName="Doe" PositionID="49" Position="SB" PlayerNumber="71" PlayerStatus="false" PlayerCode="0123456" ScopedPlayerCode="12345" HeightInches="69" WeightPounds="190" BirthDate="2/22/1991" BirthState="Ontario" BirthStateAbbr="ON" BirthCountryID="2" BirthCountry="Canada" BirthCountryAbbr="CAN" School="St. Mary's (CA)" Import="false">


    Anybody encounter this sort of file before? Any ideas?

    Thanks!



  • 2.  RE: XML datalinq

    Posted 05-11-2017 15:25

    Just want to clarify the issue a little bit. In this image, I'm pulling the jersey number of the second player in the record (which is where the <2> comes from) but his jersey number is 44.
    This is in contrast to how excel does it, where your jersey number can match the row number and you can easily use a relid in your datalinq. I don't see how I can get that to work with this xml file. Any ideas would be appreciated.


    #XPression


  • 3.  RE: XML datalinq

    Posted 05-11-2017 17:02
    You can replace the <2> with to fetch the record for player number 71.
    Like this:
    HomeTeam\Players\CFLPlayer
    #XPression


  • 4.  RE: XML datalinq

    Posted 05-11-2017 18:09
    Fantastic, Thanks Brian as always!
    #XPression


  • 5.  RE: XML datalinq

    Posted 10-01-2019 22:55

    Hey guys I know this is old but I'm trying to do this exact same thing...

    Brian I don't quite understand your comment. I think it may be missing something after moving to this new forum.

    Any clarification would be greatly appreciated. Thanks.


    #XPression


  • 6.  RE: XML datalinq

    Posted 10-02-2019 12:16

    It would be something like this, depending on what the xml element holding the jersey is called:

    HomeTeam\Players\CFLPlayer<PlayerNumber=71>

     


    #XPression


  • 7.  RE: XML datalinq

    Posted 06-28-2020 22:44

    Hey <x-zendesk-user data-user-name="Brian Ford">372361507432</x-zendesk-user>,

    Is there a way to do these both at once? For lack of a better way to describe.

     

    In my instance, I'm doing something like this:

    channel\Race<%race%>\PriceData\gpPrices\prices\priceRecords\PriceRecord<poolID=PL>\paid

    But how do I target additional PriceRecords with poolID=PL ? 

    In this case, I want to use:

    channel\Race<%race%>\PriceData\gpPrices\prices\priceRecords\PriceRecord<2>\paid
    channel\Race<%race%>\PriceData\gpPrices\prices\priceRecords\PriceRecord<3>\paid

    But targeting poolID=PL will only give me the first one.

     

    Appreciate any help!


    #XPression


  • 8.  RE: XML datalinq

    Posted 06-29-2020 01:43

    In version 6.7 and above you should be able to do PriceRecord<poolID=PL<2>>

     

     

    version 6.7 build 3728 (October 28th 2016)

    ⦁ [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.


    #XPression


  • 9.  RE: XML datalinq

    Posted 06-29-2020 19:11

    Fantastic! Thanks <x-zendesk-user data-user-name="Brian Ford">372361507432</x-zendesk-user> !

    One other thing.. are operators supported at all? I've tried things based of W3schools. 

    I'm trying to accomplish something like:

    channel\Race<%race%>\PriceData\gpPrices\prices\priceRecords\PriceRecord<poolID=PL and results=@First@>\paid

    But can't figure out a way to make it work.


    #XPression


  • 10.  RE: XML datalinq

    Posted 06-29-2020 19:17

    XPression is not using standard xpath, so what you find on W3schools wont be much use.

    In version 6.7 and above, you should be able to separate multiple search queries by a semicolon.  See the example described in the change log below.

     

    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>


    #XPression


  • 11.  RE: XML datalinq

    Posted 06-29-2020 19:20

    Ah! Perfect. MVP, thank you!


    #XPression