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] XSLT with DOM or SAX ?

[ Lists Home | Date Index | Thread Index ]
  • To: "'Kurt Riede'" <kriede@users.sourceforge.net>
  • Subject: Re: [xml-dev] XSLT with DOM or SAX ?
  • From: Robert Koberg <rob@koberg.com>
  • Date: Mon, 28 Mar 2005 10:13:18 -0800
  • Cc: xml-dev@lists.xml.org
  • In-reply-to: <200503281759.j2SHx1f09006@server1.livestoryboard.com>
  • References: <200503281759.j2SHx1f09006@server1.livestoryboard.com>
  • User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Michael Kay wrote:
>>Concerning your discussion about performance of 
>>transformation, I have a related question:
>>
>>Suppose we have a big XML document (>10MB) that rarely 
>>changes. Now we want to transform it very often (>100 per 
>>minute) in different ways, to extract and transform different 
>>parts of the XML to distinct targets. 
>>What is the best practise?
>>Is there a way to make the transformer to cache the internal 
>>optimized representation of the XML?
> 

You could stick it into the XSL stylesheet itself (using XInclude 
perhaps an entity). Then you can cache the Templates object. Then when 
you transform, you could access the included XML with something like:

Source XML:
<whatever/>

XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:my="my" version="1.0">

   <my:something boo="foo"/>

   <xsl:template match="/">
     <boo>
       <xsl:value-of
         select="document('')/xsl:stylesheet/my:something/@boo"/>
     </boo>
   </xsl:template>

</xsl:stylesheet>

best,
-Rob




 

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

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