April 13, 201015 yr Newbies Hi all, New to xml to filemaker pro transformation and import. Help would be much appreciated. I am trying to import the following xml: <?xml version="1.0" encoding="UTF-8"?> Monterey Herbson's Pices 1 12-01-2002 23.54 ABC1231Oregano23.5423.54 2 01-06-2003 15.45 23_45d2Rosemary5.0010.00 t4565Thyme1.095.45 New York A Pealing Desserts 1 11-15-2002 115.00 ABC1235Lemon Zests23.00115.00 I have an xslt file that correctly imports the customers into a customers table. I'm having problems importing the orders records which needs to include the attribute value in element. When I run the following xslt, the customer id value in column 1 is always 2: <?xml version='1.0' encoding='UTF-8' ?> 0 Output: <?xml version="1.0" encoding="utf-8"?> 0 2 ORD2 12-01-2002 23.54 2 ORD3 01-06-2003 15.45 2 ORD4 11-15-2002 115.00
April 13, 201015 yr Either one of these should work: However, you have a problem in the source XML document: XML is case-sensitive. Using "id" for one customer and "ID" for another is not easy to handle.
April 13, 201015 yr Author Newbies Auuughh. The dreaded upper/lower case problem. Thanks for spotting that. The other error you pointed out fixed the problem. I still have a question: What is the difference between: /customers/customer/@id AND ancestor::customer/@id Why aren't they equivalent?
April 13, 201015 yr You are in a loop at the order level. In order to get the info for the customer of the CURRENT order, you need to look UP. The expression "/customers/customer/@id" starts at the root level, and looks DOWN - and returns data from the first customer it finds.
Create an account or sign in to comment