shortmatt Posted June 21, 2006 Posted June 21, 2006 Has anyone experienced XML that has multiple "data" lines for each "col"? How do you get the XSL to take that into consideration? For example: Client 1 CLIE1 Jim Bob Billy Sue Client 2 CLIE2 Billy Ray Susie Q I can get the XSL to display Jim Bob, but skips Billy Sue and proceeds to the next client, Client 2 and displays Billy Ray, but not Susie Q. Anyone else have this problem? What was your work-around?
Fenton Posted June 21, 2006 Posted June 21, 2006 Multiple DATA elements are what you get if you export related records, such as in a portal. What you do about it depends on whether you're Importing or Exporting. If exporting, as it appears the above is, you'd use either another or an . You'd want to know which COL (field) you expected possible multiples (perhaps it wouldn't matter; but no use making the xsl look where there isn't). That will get the repetitive data in the multiple DATA elements for one related field. The trouble is that you often want to get more than one related field at once. A method I've used is to decide which is the "determining" field; ie., which field will have data; much like counting related records. Then get that field, and the other related fields. If you cannot be sure that one of the fields has data, then you can export an ID which you know does. You can use it in the . You don't have to output the value. You have to go back "up" 2 levels (), then down again, to get the other related fields. Because the next field in the FileMaker portal is going to be in the next COL, but at the same position as the data you're getting. Notice I'm using a variable to get the position of the DATA element being currently processed, then using that to say which DATA to get. (P.S. You can also use multiple for this. It's a little more abstract, so I don't use it as much; but perhaps I should.)
shortmatt Posted June 27, 2006 Author Posted June 27, 2006 fenton: Thanks for the insight. I found using the variable helpful. Do you know of a template available that builds this into a table? That's what I'm after. The HTML table that I've just created has all values for each data set run together in the same cell. I'm new at the XML / XSL game and am trying hard to learn what I'm doing. Any templates that I can study will help me get over the learning curve! Thanks again! --Matt
Recommended Posts
This topic is 6724 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 accountSign in
Already have an account? Sign in here.
Sign In Now