AnsweredAssumed Answered

XML and XSLT Help

Question asked by Ted on Jun 9, 2010
Latest reply on Jun 9, 2010 by Ted

Title

XML and XSLT Help

Post

I am very new to XML and XSLT and need a little help. I need to convert the fileMaker exported xml file that looks like this .... 

<?xml version="1.0" encoding="UTF-8" ?><FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult"><ERRORCODE>0</ERRORCODE><PRODUCT BUILD="03-05-2010" NAME="FileMaker" VERSION="ProAdvanced 11.0v1"/><DATABASE DATEFORMAT="Yyyy-m-d" LAYOUT="" NAME="Demo Copy 1.fp7" RECORDS="5" TIMEFORMAT="h:mm:ss a"/><METADATA><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Coupon" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Credit Memo" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Customer ID" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Date Created" TYPE="TIMESTAMP"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Invoice ID" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Response" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Search Email" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Search First Name" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Search Last Name" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Ship Date" TYPE="DATE"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Source Of Sale" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Their Email" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Total" TYPE="NUMBER"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Address" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To City" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Customers::Bill To Company" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Country" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Email" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To First Name" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Customers::Bill To Full Name" TYPE="NUMBER"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Last Name" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Postal Code" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Bill To Province" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Customers::Global ID" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Address" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To City" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Customers::Ship To Company" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Country" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Email" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To First Name" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Last Name" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Postal Code" TYPE="TEXT"/><FIELD EMPTYOK="NO" MAXREPEAT="1" NAME="Customers::Ship To Province" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Inventory::Name" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Inventory::Warning" TYPE="NUMBER"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Lines::Inventory ID" TYPE="TEXT"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Lines::Price" TYPE="NUMBER"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Lines::Price Extended" TYPE="NUMBER"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Lines::Quantity" TYPE="NUMBER"/><FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="Lines::Taxable" TYPE="NUMBER"/></METADATA><RESULTSET FOUND="4"><ROW MODID="1" RECORDID="13328"><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>7896</DATA></COL><COL><DATA>2010-06-04 2:26:14 PM</DATA></COL><COL><DATA>14327</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>42</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>1</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>This is my product</DATA></COL><COL><DATA></DATA></COL><COL><DATA>1</DATA></COL><COL><DATA>14</DATA></COL><COL><DATA>42</DATA></COL><COL><DATA>3</DATA></COL><COL><DATA></DATA></COL></ROW><ROW MODID="16" RECORDID="13329"><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>2010-06-04 2:27:55 PM</DATA></COL><COL><DATA>14328</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>Ebay</DATA></COL><COL><DATA></DATA></COL><COL><DATA>292</DATA></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL></COL><COL><DATA>This is my product</DATA><DATA>This is another product</DATA></COL><COL><DATA></DATA><DATA>➤</DATA></COL><COL><DATA>2</DATA><DATA>1</DATA><DATA>1</DATA></COL><COL><DATA>12</DATA><DATA>14</DATA><DATA>14</DATA></COL><COL><DATA>12</DATA><DATA>280</DATA><DATA>0</DATA></COL><COL><DATA>1</DATA><DATA>20</DATA><DATA></DATA></COL><COL><DATA>✓</DATA><DATA></DATA><DATA></DATA></COL></ROW><ROW MODID="5" RECORDID="13330"><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>7896</DATA></COL><COL><DATA>2010-06-07 1:51:49 PM</DATA></COL><COL><DATA>14329</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA> </DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>Amazon</DATA></COL><COL><DATA></DATA></COL><COL><DATA>600</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>1</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>This is another product</DATA></COL><COL><DATA>➤</DATA></COL><COL><DATA>2</DATA></COL><COL><DATA>12</DATA></COL><COL><DATA>600</DATA></COL><COL><DATA>50</DATA></COL><COL><DATA>✓</DATA></COL></ROW><ROW MODID="0" RECORDID="13332"><COL><DATA></DATA></COL><COL><DATA>Replace</DATA></COL><COL><DATA>7896</DATA></COL><COL><DATA>2010-06-07 3:19:40 PM</DATA></COL><COL><DATA>14331</DATA></COL><COL><DATA>OK!!!</DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA></DATA></COL><COL><DATA>INV 1022

I would like to returewrn the item

please ship to :

88 Peach
Kitchener ON
N2E 3Z8

reason for return: kjadl;kfjal kflkaj lk lkjlkjaf lkdjslkfaj;fljad



</DATA></COL><COL><DATA>0</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>1</DATA></COL><COL><DATA>A Street</DATA></COL><COL><DATA>A City</DATA></COL><COL><DATA>Corey Blad</DATA></COL><COL><DATA>Canada</DATA></COL><COL><DATA>coreyblad9@hotmail.com</DATA></COL><COL><DATA>Corey</DATA></COL><COL><DATA>Blad</DATA></COL><COL><DATA>N2L 1V4</DATA></COL><COL><DATA>ON</DATA></COL><COL><DATA>This is another product</DATA></COL><COL><DATA>➤</DATA></COL><COL><DATA>2</DATA></COL><COL><DATA>12</DATA></COL><COL><DATA>0</DATA></COL><COL><DATA>2</DATA></COL><COL><DATA>✓</DATA></COL></ROW></RESULTSET></FMPXMLRESULT>

 

 

and turn it into something that looks like this...

 

<DAZzle Start="PRINTING" Prompt="NO"
OutputFile="~/Documents/endicia-out.xml" Test="NO">
<Package ID="1">
        <MailClass>PRIORITY</MailClass>
        <FlatRate>FALSE</FlatRate>
        <DateAdvance>1</DateAdvance>
        <WeightOz>5</WeightOz>
        <TotalPostage></TotalPostage>
        <Services DeliveryConfirmation="ON" InsuredMail="OFF"></Services>
        <Value>14.00</Value>
        <Description>test 1</Description>
        <ToName>Aaron Tuller</ToName>
        <ToCompany>buyolympia.com</ToCompany>
        <ToAddress1>929 Legion Way SE</ToAddress1>
        <ToAddress2></ToAddress2>
        <ToCity>Olympia</ToCity>
        <ToState>WA</ToState>
        <ToPostalCode>98501</ToPostalCode>
</Package>
</DAZzle>

Just wondering if anyone has done something like this and if they can point me in the right direction to help me get started on this. Thank you! 

 

Outcomes