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] in place ordering of XML

[ Lists Home | Date Index | Thread Index ]


Your specification of the problem is very incomplete, but my design
approach would be to generate from the schema an XSLT stylesheet of the
form:

<xsl:variable name="element-list"
select="'foo bar pooh ... '"/>

<xsl:template match="...">
  <xsl:for-each select="*">
  <xsl:sort select="string-length(substring-before($element-list,
                         concat(name(), ' ')"
            data-type="number"/>
    <xsl:copy-of select="."/>
  </xsl:for-each>
</xsl:template>

Michael Kay

> 
> My Application is  recieving a sequence of XML Nodes. I need 
> to create a 
> XML Doc from these ,having all these nodes in order as 
> dictated by the 
> schema , "in the most efficient of ways"..
> For e.g. if the schema is saying
> 
> <xsd:element name = "foo">
> <xsd:element name = "bar">
> <xsd:element name = "pooh">
> 
> If I get the xml nodes in the order "bar", "pooh" and "fooh", 
> the tree 
> should be built with these in order as in the schema.
> 
> i.e.
> <target>
> <foo>
> <bar>
> <pooh>
> </target>
> 
> Any help wuld be appreciated.
> 
> rgds,
> Menon
> 
> 
> 
> -- 
> Ramkumar Menon,
> Oracle India Pvt Ltd,
> Bangalore - 82
> 
> 
> -----------------------------------------------------------------
> 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://lists.xml.org/ob/adm.pl>





 

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

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