[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: including files

Subject: RE: including files
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Wed, 10 Jul 2002 09:36:29 +0100
uriresolver zip file
Mike Brown:
>I kind of wish I could find a better example. We all allude to the
'custom 
>URIResolver' approach, but we never provide any code samples :)

Im trying to do just this at the moment - my stylesheets are going to be
deployed as a zip file so I have to write a custom UriResolver to ensure
my <xsl:include>'s look in the right place.  There dont seem to be too
many examples out there - I found one at:

http://access1.sun.com/technotes/00762.html

Can anyone offer any more?  

cheers
andrew



-----Original Message-----
From: Mike Brown [mailto:mike@xxxxxxxx]
Sent: 09 July 2002 19:09
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: n8_shaw@xxxxxxxxx
Subject: Re:  including files


I wrote:
> I think you're on the right track. I would use document() but instead
of
> pointing directly to the file, point to a URI that, when resolved,
will
> deliver a well-formed document. You usually have the option of
customizing the
> URI resolver (see JAXP's javax.xml.transform.UriResolver interface,
and
> setUriResolver() on the Transformer or TransformerFactory) so that it
delivers
> whatever you need. 
> 
> For example, for document('urn:nate-frag.xhtml'), your URI resolver
> could look for 'urn:nate-' and then know that it needs to return
> something like
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE wrapper [ <!ENTITY content SYSTEM "frag.xhtml"> ]>
> <wrapper>&content;</wrapper>

I kind of wish I could find a better example. We all allude to the
'custom 
URIResolver' approach, but we never provide any code samples :)

Anyway I wanted to add that the concept of 'resolving' a URI in some
places
means just merging a given relative or absolute URI with an absolute
base,
producing just a new URI string. And sometimes, it is assumed to mean
that you
not only merge the two strings, but you also return a representation of
the
identified resource. The JAXP URIResolver does this, returning a Source
implementation (DOMSource, SAXSource, or StreamSource, usually).

I decided about 9 months ago that I like Python a whole lot better than
Java,
so someone else will have to post an example!

   - Mike
________________________________________________________________________
____
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume:
http://skew.org/~mike/resume/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 01/07/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 01/07/2002
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.