[
Lists Home |
Date Index |
Thread Index
]
> That sounds promising. The whole idea is that attribute heavy flat xml has an
> obvious normalization that I want to accomplish using the <g><e/></g> reformatting
> ... by the simplest most obvious means possible.
For example, the following is a complete xslt stylesheet that will
convert your <g><e>... input documemt to a series of record elements
with all attributes copied.
<records xsl:version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:for-each select="//e">
<xsl:element name="{ancestor-or-self::*[@ename][1]/@ename}">
<xsl:copy-of
select="ancestor-or-self::*/@*[not(name()='ename')] |
ancestor::*/gi/@*"/>
</xsl:element>
</xsl:for-each>
</records>
Going in the reverse direction isn't a lot more complicated.
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
|