Subject:Creating embedded structures for XML to XML conversion Author:Wayne Watson Date:08 Jan 2007 02:16 PM
I am not very strong with XSLT, and I am pretty sure that I am not doing this is the ideal fashion so I am hoping someone can point me in the right direction.
I have a program that I am using that has a defined xml structure that is tedious to work with for defining data. So I am trying to use xslt to remap the xml into an embedded structure that can be used with General Interface.
A single xml document will contain several tables, the <tc> element defines the table column, and there has to be a matching number of <td> (table data) elements to <tc> elements, the <td> elements are under the <tr> elements, there can be any number of <tr> elements.
The CDF format is very simple with just a data element and record elements, everything is defined as attributes of the element. It allows for nested record structures and this is partly where I am running into an issue. This is the structure that I am trying to get out with XSLT as matched with the example input shown above.
My goal is that for each table, sub-group each tr/td with the corresponding tc element.
I have been using Stylus Stuido and I have actually been able to get most of the xslt working to transform the data, the issue that I am having is matching the td element to the corresponding tc element. I have not been able to figure out how to do it with the mapper, and I haven't been able to figure out the right way to caputre the result writing it raw.
Subject:Creating embedded structures for XML to XML conversion Author:Minollo I. Date:08 Jan 2007 02:50 PM
Wayne,
what is the logic according to which a <td> is associated to a specific <tc>? It doesn't seem to be by name, according to the example you posted; and it doesn't seem to be positional (you have many more <td>'s than <tc>'s, under different <tr>'s).
Subject:Creating embedded structures for XML to XML conversion Author:Wayne Watson Date:08 Jan 2007 05:15 PM
The relationship is positional; in any given table the number of <tc>s has to equal the number of <td>s, the <tc> element represents the table column name, the <td> represents that table column data for that table row.
For every table you can have a flexible number of <tc> and <td> elements as long as they are equal.