OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Idea - std. non-flat <g><e/></g> syntax

[ Lists Home | Date Index | Thread Index ]

Cool! Thanks for this reply, David.

The result is not quite right because each etext attribute was supposed to become the
contents of each <record></record>.

Going the other way might require reordering the groups of records to place all with
identical attributes together. Or the stylesheet could explicitly state the matching
attributes that cause a <g><e/></g> block and that would be pretty easy. What is
interesting is that users would do this grouping themselves ... they would do it as a
matter of convenience when creating the <g><e/></g> blocks.

The ultimate improvement of your example is an identity transform copying everything
verbatim except this expansion of the <g><e/></g>. That is the stylesheet that would
substantially implement what I am proposing for files preprocessed against the
stylesheet. How easy is that? :)


bill p

David Carlisle wrote:

> > 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
> ________________________________________________________________________
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS