Jump to content
Server Maintenance This Week. ×

Help with xslt transformation


larmister

This topic is 5129 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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

Link to comment
Share on other sites

  • 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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5129 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.