[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Generic stylesheet to flatten XML hierarchy
On 4 Dec 2009, at 12:37 , Sara Mitchell wrote:
...
Perhaps the transformation you have in mind is intended to work generically on all XML documents that follow certain conventions in structuring the information they represent? Can you say what those conventions are? Perhaps you have a very clear understanding of the transform you want, but so far this discussion has not elicited a clear description from you. The following questions are intended to try to elicit some more clarity. In a generic XML document, there are elements with parents, left and right siblings, children, descendants, and attributes. In a generic table, there are rows and columns. Each row but the first or last has a predecessor and a successor, and ditto each column but the first or last. What is the relationship between the elements, attributes, containment and sibling relations in the input, and the rows and columns and their sequence relations in the output? Given your output table, should I expect to have all the information present in the XML? Can I recreate the XML from your table? Do all your rows have the same number of columns? (I suppose they must, or it's not much of a table, but perhaps I'd better check?) When does an XML document give rise to a single row in the output table? When does it give rise to exactly three rows? When does the resulting table have exactly one column? What information do the labels of columns convey? What tables would you want to produce for the documents (1) <e/> (2) <e><e n="23"/><e n="45">Pax</e></e> (3) <table> <row a="1" b="2" c="34">998</row> <row a="2" b="22" c="34">999</row> <row a="3" b="2" c="3">1000</row> <row a="4" b="24" c="">1001</row> <row a="5" x="Viva Villa!" c="34">998</row> </table> (4) <p>This isn't mixed content, because the schema says I'm a string.</p> ?
<a><b/><b/><b/><c/><c/><c/></a> be treated differently from <a><b/><c/><b/><c/><b/><c/></a> ? (Assume if you like, for purposes of discussion, that the b and c and a elements all have interesting attributes.)
But probably you know exactly what you're doing, there is a perfectly reasonable algorithm for what you want, and I just haven't understood. hth -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net ****************************************************************
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|