Hi Folks,

I'm encountering some strange behaviour with file paths when trying to use Xalan (first time user, so perhaps newbie mistake), and I wonder if someone can enlighten me.

I have the following code:

--
TransformerFactory tFactory = TransformerFactory.newInstance();
Reader reader = new FileReader
("/home/richard/workspace/dspace-trunk/ore4j/src/main/resources/rdfxml2rdfa.xsl");
StreamSource xslt = new StreamSource(reader);

Transformer transformer = tFactory.newTransformer(xslt);

String serialisation = rmd.getSerialisation(); serialisation = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + serialisation;

StreamSource rdfxml = new StreamSource(serialisation);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StreamResult result = new StreamResult(baos);
transformer.transform(rdfxml, result);
--

When I run this I get the following error on the final line (full stack trace at the end of the email):

ERROR:  '/home/richard/workspace/dspace-trunk/< (No such file or directory)'
ERROR: 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /home/richard/workspace/dspace-trunk/< (No such file or directory)'

My stylesheet contains no reference to that path /home/richard/workspace/dspace-trunk; the only place it is referenced in my code at all is in the FileInputStream constructor. Then there is what looks like an errant "<" in the path; I can't see where that might be coming from. The directory /home/richard/workspace/dspace-trunk does exist, as does the xsl file I referenced. I have been able to perform this crosswalk from the command line with xalan, so I know there's no problem there.

Any ideas what I might be doing wrong?  I am using xalan 2.7.0.

Any help gratefully appreciated,

Cheers,

Richard
----------------------------------

Exception in thread "main" org.openarchives.ore.ORESerialiserException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /home/richard/workspace/dspace-trunk/< (No such file or directory) at org.openarchives.ore.rdfa.RDFaORESerialiser.serialise(RDFaORESerialiser.java:77)
   at org.openarchives.ore.test.ORETest.rdfaWriting(ORETest.java:119)
   at org.openarchives.ore.test.ORETest.main(ORETest.java:42)
Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /home/richard/workspace/dspace-trunk/< (No such file or directory) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:720) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) at org.openarchives.ore.rdfa.RDFaORESerialiser.serialise(RDFaORESerialiser.java:58)
   ... 2 more
Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /home/richard/workspace/dspace-trunk/< (No such file or directory) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:547) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:710)
   ... 4 more
Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /home/richard/workspace/dspace-trunk/< (No such file or directory) at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:446) at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:234) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:525)
   ... 5 more

Reply via email to