Okay
  Public Ticket #3806748
Filtering XML data various tables
Open

Comments

  • Frederik started the conversation

    Hi,

    I have one XML sheet with mulitple collections of products. In one table, i wish to show collection "A", and in another I wish to show collection "B" – and so on. How can I filter the data from the XML by collection name? I have mulitple tables that use data from the same XML sheet, I just wish to filter it. NOT for the user on the frontend, but in the specific Table in the wpDataTables backend so:

    [wpdatatable id=1] shows data with collection name "A"

    [wpdatatable id=2] shows data with collection name "B"


    ... and so on. Heres some test/workin progress XML code:

    <products>
        <product collection="Terra Cotta" SKU="TC123" Name="Pot A" Color="Red" Size="Small" Variant="Round"/>
        <product collection="Terra Cotta" SKU="TC124" Name="Pot B" Color="Brown" Size="Large" Variant="Square"/>
        <product collection="Glazed" SKU="GL567" Name="Pot C" Color="Blue" Size="Medium" Variant="Round"/>
        <product collection="Glazed" SKU="GL568" Name="Pot D" Color="Green" Size="Large" Variant="Oval"/>
        <product collection="Heritage" SKU="HR345" Name="Pot E" Color="White" Size="Small" Variant="Classic"/>
        <product collection="Heritage" SKU="HR345" Name="Pot E" Color="White" Size="Small" Variant="Classic"/>
    </products>



    Hope you can help!

    Best Frederik

  • Frederik replied

    Here's the question made simpler:
    • I have one xml sheet with various products
    • I need tables that can filter from this XML, preferably based on product name.

    Example:
    One one page I need a table with the product "Atlas". I only need Atlas' data displayed in the table here. No user interaction, no user filtering. Just from around 1 to 20 rows of data.

    My XML could look like this – hiding the column "Name" in the frontend (since I'd make my own text above the tables):

    <Products>
        <product Name=“Atlas” DiameterCM="12" DiameterIN="4,7" HeightCM="13" HeightIN="5.1"  Color="●●" Casepack="15" Wholesale="300" RRP="300"/>
        <product Name=“Atlas” DiameterCM="14" DiameterIN="5,5" HeightCM="16" HeightIN="6.3" Color="●●" Casepack="10" Wholesale="450" RRP="330"/>
        <product Name=“Atlas” DiameterCM="16" DiameterIN="6,3" HeightCM="18" HeightIN="7.1" Color="●●" Casepack="8" Wholesale="567" RRP="360"/>
        <product Name=“Atlas” DiameterCM="18" DiameterIN="7,1" HeightCM="20" HeightIN="7.9" Color="●●" Casepack="5" Wholesale="623" RRP="380"/>
        <product Name=“Atlas” DiameterCM="21" DiameterIN="8,3" HeightCM="23" HeightIN="9" Color="●●" Casepack="3" Wholesale="768" RRP="456"/>
        <product Name=“Atlas” DiameterCM="25" DiameterIN="9,8" HeightCM="28" HeightIN="11" Color="●●" Casepack="2" Wholesale="796" RRP="680"/>
        <product Name=“Pantheon” DiameterCM=“8” DiameterIN="4,7" HeightCM="13" HeightIN="5.1"  Color="●●" Casepack="15" Wholesale="300" RRP="300"/>
        <product Name=“Pantheon” DiameterCM=“9” DiameterIN="5,5" HeightCM="16" HeightIN="6.3" Color="●●" Casepack="10" Wholesale="450" RRP="330"/>
        <product Name=“Pantheon” DiameterCM="10” DiameterIN="6,3" HeightCM="18" HeightIN="7.1" Color="●●" Casepack="8" Wholesale="567" RRP="360"/>
        <product Name=“Pantheon” DiameterCM="11” DiameterIN="7,1" HeightCM="20" HeightIN="7.9" Color="●●" Casepack="5" Wholesale="623" RRP="380"/>
        <product Name=“Pantheon” DiameterCM=“12” DiameterIN="8,3" HeightCM="23" HeightIN="9" Color="●●" Casepack="3" Wholesale="768" RRP="456"/>
        <product Name=“Pantheon” DiameterCM=“13” DiameterIN="9,8" HeightCM="28" HeightIN="11" Color="●●" Casepack="2" Wholesale="796" RRP="680"/>
        <product Name=“Flora” DiameterCM=“8” DiameterIN="4,7" HeightCM="13" HeightIN="5.1"  Color="●●" Casepack="15" Wholesale="300" RRP="300"/>
        <product Name=“Flora” DiameterCM=“9” DiameterIN="5,5" HeightCM="16" HeightIN="6.3" Color="●●" Casepack="10" Wholesale="450" RRP="330"/>
        <product Name=“Flora” DiameterCM="10” DiameterIN="6,3" HeightCM="18" HeightIN="7.1" Color="●●" Casepack="8" Wholesale="567" RRP="360"/>
        <product Name=“Flora” DiameterCM="11” DiameterIN="7,1" HeightCM="20" HeightIN="7.9" Color="●●" Casepack="5" Wholesale="623" RRP="380"/>
        <product Name=“Flora” DiameterCM=“12” DiameterIN="8,3" HeightCM="23" HeightIN="9" Color="●●" Casepack="3" Wholesale="768" RRP="456"/>
        <product Name=“Flora” DiameterCM=“13” DiameterIN="9,8" HeightCM="28" HeightIN="11" Color="●●" Casepack="2" Wholesale="796" RRP="680"/>
    </Products>


    Is there a way to show only "Atlas" in one table and "Pantheon" in another, and so on so fouth? I have around 30 dirrerent products