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: Michael Kay <mike@saxonica.com>
  • Subject: Re: [xml-dev] XSLT with DOM or SAX ?
  • From: Robert Koberg <rob@koberg.com>
  • Date: Mon, 28 Mar 2005 11:36:13 -0800
  • Cc: "'Kurt Riede'" <kriede@users.sourceforge.net>, xml-dev@lists.xml.org
  • In-reply-to: <200503281924.j2SJOUf09739@server1.livestoryboard.com>
  • References: <200503281924.j2SJOUf09739@server1.livestoryboard.com>
  • User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Michael Kay wrote:
>>You could stick it into the XSL stylesheet itself (using XInclude 
>>perhaps an entity). Then you can cache the Templates object.
> 
> 
> That might work with some processors. With Saxon, it won't. Saxon never
> pre-evaluates the document() function at compile time. There could be a
> run-time URIResolver that redirects the URI (even "") to somewhere else.

OK - I was guessing :)

If no resolver for "", wouldn't the the transformation work on an 
already parsed tree (cached in the Templates object??) for the 
particular processor? Does document('') load the XSL from the source again?

I wonder how other processors deal with it??

-Rob


> 
> Also, I think the originator wanted to transform the same source document
> using different stylesheets.
> 
> Michael Kay
> http://www.saxonica.com/
> 
>  
> 
>>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