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

Re: Managing semi-trivial sets of stylesheets.

Subject: Re: Managing semi-trivial sets of stylesheets.
From: Paul Tchistopolskii <paul@xxxxxxx>
Date: Wed, 07 Jun 2000 03:47:27 -0700
org.xml.sax.inputsource include relative path
> > 1. I don't like the absolute path because:..
> > 2. I don't like the relative path because:..
> > Is there some  'XML mainstream' solution to this small problem? 
> 
> If you really feel strongly about it 

Unfortunately yes ...  I am building the framework which is based 
on the idea that there are many small  stylesheets ... combined in 
some ways...

> you could use a URL such as
> http://www.pault.com/servlet/GetStylesheetModule?name=a.xsl
> 
> and write the relevant servlet.

 ... overhead ....
 
> Or you could stick a SAX filter between the stylesheet parser and the XSLT
> processor.

That's what I did - I was wondering maybe there is something
better...

import org.xml.sax.*;
import com.pault.ux.FS;

/**
 * Creation date: (6/1/00 1:53:41 PM)
 * @author: Paul Tchistopolskii
 */

public class UxSpecialXMLParser extends com.jclark.xml.sax.CommentDriver {

 public void parse(org.xml.sax.InputSource in) throws 
  java.io.IOException, org.xml.sax.SAXException {

   String sysid =  in.getSystemId();
   
   if ( sysid.startsWith("file:") && !sysid.startsWith("file:" + FS.m_Root ) ) {
     in.setSystemId( "file:" + FS.m_Root + sysid.substring(5) );
   }
  
   super.parse( in );
 }

}

Setting this 'parser'  for  XT allows me to write 
<xsl:include = "/stdio/common.xsl"/> and then don't care about the 
prefix directory.

The side-effect with XT ( and I guess with any other XSLT implementation )
is that this affects document() as well, because document() invokes the 
same parser ;-) But this is OK with me - makes life even easier, because 
moving the entire project to any directory requires changing only one 
place.

Rgds.Paul.

PS. Eric suggested entities to do the same, but I'm almost afraid of 
entities. 



 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.