widget218

Need help with the Format of my XLST File please

Discussion created by widget218 on Nov 13, 2018
Latest reply on Nov 15, 2018 by beverly

Hi

 

I hope Im posting this in the right place.

I am a novice at importing XML Files into Filemaker using XLST format files.

I have been sucessful at importing individual Fields from an XML File with an XLST Format File but I dont understand what syntax I need in the XLST Format File to import a recurring XML field into a repating field in my Filemaker record.

 

Heres my XML and XLST File examples.

 

My question is what do I need to write into my XLST File to get all the Ingredients into the Filemaker repeating fields

Name[50]

Description[50]

Wheretobuy[50]

AdressInfoAdress[50]

?

 

The

<xsl:for-each select="Recipe/Ingedientlist/Ingedient">

<ROW>

</ROW>

</xsl:for-each>

statement was my first (failed) attempt...

 

Any tipps are well appreciated, thank you.

with best wishes,

Widget

 

XML FILE

 

    <Recipe>

            <Creator>

                <CreatorPerson>

                    <Name>Willy</Name>

                    <Issue>Wonka</Surname>

                </CreatorPerson>

        </Creator>

             <Title>Cookies</Title>

             <IngedientList FullListYN="Y">

                <Ingedient EssentialYN="Y">

                    <Name>Chocolate</Name>

                    <Description>Chocolate Chips</Description>

                    <Wheretobuy>Sainsburies</Wheretobuy>

                    <AdressInfo>

                        <Adress>Down the roundabout on the left</Adress>

                    </AdressInfo>

                </Ingedient>

                <Ingedient EssentialYN="Y">

                    <Name>Sugar</Name>

                    <Description>Cane Sugar</Description>

                    <Wheretobuy>ASDA</Wheretobuy>

                    <AdressInfo>

                        <Adress>in the highstreet</Adress>

                    </AdressInfo>

                </Ingedient>

                <Ingedient EssentialYN="Y">

                    <Name>Margarine</Name>

                    <Description>Fat for everyone</Description>

                    <Wheretobuy>Tesco</Wheretobuy>

                    <AdressInfo>

                        <Adress>I cant believe its not butter</Adress>

                    </AdressInfo>

                </Ingedient>

         </IngedientList>

    </Recipe>

 

 

XLST FILE

 

<METADATA>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Recipe.Creator.CreatorPerson.Name" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Recipe.Creator.CreatorPerson.Surname" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Recipe.Title" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="50" NAME="Recipe.Ingedientlist.Ingedient.Name" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="50" NAME="Recipe.Ingedientlist.Ingedient.Description" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="50" NAME="Recipe.Ingedientlist.Ingedient.Wheretobuy" TYPE="TEXT"/>

<FIELD EMPTYOK="YES" MAXREPEAT="50" NAME="Recipe.Ingedientlist.Ingedient.AdressInfo.Adress" TYPE="TEXT"/>

 

and further down

<COL>

<DATA>

<xsl:value-of select="Recipe/Creator/CreatorPerson/Name"/>

</DATA>

</COL>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Creator/CreatorPerson/Surname"/>

</DATA>

</COL>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Title"/>

</DATA>

</COL>

 

<xsl:for-each select="Recipe/Ingedientlist/Ingedient">

 

<ROW>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Ingedientlist/Ingedient/Name"/>

</DATA>

</COL>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Ingedientlist/Ingedient/Description"/>

</DATA>

</COL>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Ingedientlist/Ingedient/Wheretobuy"/>

</DATA>

</COL>

 

<COL>

<DATA>

<xsl:value-of select="Recipe/Ingedientlist/Ingedient/AdressInfo/Adress"/>

</DATA>

</COL>

 

</ROW>

</xsl:for-each>

Outcomes