This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: XSL manipulating two XMLs


I forgot to mention that getSystemId() id returns the correct path of the
XML file. i.e

Is not it the goal that Source.getSystemId() should return the correct path
to the XML file being loaded using document()?


href in URIResolver:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml
system id in get:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml
system id in get:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml

-----Original Message-----
From: Najmi, Jamal
Sent: Thursday, May 02, 2002 12:58 AM
To: 'xsl-list@lists.mulberrytech.com'
Subject: RE: [xsl] XSL manipulating two XMLs


Yes, my two XML documents and XSL file are in the same directory.

I tried the '/' but it did not work. I think my problem comes even before
that, when the document is read by the transformer.  Transformer is looking
in the processor's directory.

I have tried implementing the URIResolver and Source interfaces, but I am
still geting errors. 

Here is the listing of my implementation classes:

******************************************
import javax.xml.transform.URIResolver;
import javax.xml.transform.TransformerException ;
import javax.xml.transform.Source;

 public class URIResolverImpl implements URIResolver {
        private final static String  FILE_SEPARATOR_PROPERTY =
System.getProperty("file.separator") ;
        private String _workingDirPath = null ;
        public URIResolverImpl(String workingDirpath) {
          _workingDirPath = workingDirpath ;
        }
       
        public Source resolve(String href, String base) throws
TransformerException {
          href  = _workingDirPath + FILE_SEPARATOR_PROPERTY + href ;
          System.out.println("href in URIResolver: " + href) ;
          Source source = new SourceImpl(href) ;
          return source ;
        }
 }          

*******************************

and

import javax.xml.transform.Source;

 public class SourceImpl implements Source {
        private final static String  FILE_SEPARATOR_PROPERTY =
System.getProperty("file.separator") ;
        private String _systemId = null ;
        public SourceImpl(String systemId) {
          _systemId = systemId ;
        }
       
        public void setSystemId(String systemId) {
          System.out.println("System id in set"  + systemId) ;
          // ignore it
        }
       
        public String getSystemId() {
          System.out.println("system id in get: " + _systemId ) ;
          return _systemId ;
        }
 }
       
***************************************

Now here is what getSystemId() returned and what got set in the URIResolver
when application ran.  This is from the standard output of tomcat.  Does
this output give any idea if I am setting something wrong in the
implementation classes?  

href in URIResolver:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml
system id in get:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml
system id in get:
/u01/artesia/teamsdne/jamalsandbox/workingdir/1020296490674/content.xml

Here is the error meesage:

SystemId Unknown; Line 50; Column 35; Can not load requested doc: Not
supported: com.artesia.cus
t.discovery.web.common.SourceImpl@437f31

Will really appreciate any help!!!

Jamal


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]