xsl-list
[Top] [All Lists]

RE: [xsl] Generic stylesheet to flatten XML hierarchy

2009-12-04 14:28:21
Ok. I don't really have real samples as this is meant to be generic but I do 
have a handle on the potential structures that need to be flattened. 
So for example, RSS which looks like this: 

/rss (some attributes)
  /channel (some attributes)
    /title
    /link
    /...more siblings that are not repeating
    /item (repeat starts)
      /title
      /description (w/mixed content)
      /pubdate
      /link
      /...more children some have descendants but no more repeats
   /item ...
   ...

If this gets converted to XML it should look on output like this: 
<root>
<row>
<rss-attr1>value</rss-attr1>

--- On Thu, 12/3/09, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:

From: Michael Kay <mike(_at_)saxonica(_dot_)com>
Subject: RE: [xsl] Generic stylesheet to flatten XML hierarchy
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Date: Thursday, December 3, 2009, 3:54 PM
I've been wandering through the
archives and other searches 
and so far have not found exactly what I am hoping to
find. I 
need to write an XSLT stylesheet that accepts an
unknown XML 
document and flattens the hierarchy to a
two-dimensional 
row/columns structure. 


The hard part of the problem is specifying what you want to
happen. Once
you've done that, I would think that coding it is fairly
easy.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--