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

RE: XSL manipulating two XMLs

Subject: RE: XSL manipulating two XMLs
From: "Najmi, Jamal" <Jamal.Najmi@xxxxxxxxxxx>
Date: Wed, 1 May 2002 20:13:22 -0400
xml system id
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@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE:  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


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.