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: TrAX


seems you are mixing saxon features and trax features.
If you want to use a certain parser, you can use a 
javax.xml.transform.sax.SAXSource instead of a StreamSource and pass the 
parser along with it.

----------------------------------
TransformerFactory factory = TransformerFactory.newInstance();

SAXSource source = new SAXSource(
     new FormatTranslatorParser(),
     new InputSource(fSource));

t.transform(source, new StreamResult(fOutFile));
----------------------------------

Cheers,
Johannes


>Hello there,
>
>I'm using the TrAX in my java application and would like
>the application to use my custom parser.
>
>I've written the following code to do this
>-------------------------------------------------
>   TransformerFactory factory = TransformerFactory.newInstance();
>
>   factory.setAttribute(FeatureKeys.SOURCE_PARSER_CLASS,
>"FormatTranslatorParser");
>
>
>   Transformer t = factory.newTransformer(new StreamSource(fStyleSheet));
>   t.transform(new StreamSource(fSource), new StreamResult(fOutFile));
>-------------------------------------------------------------
>
>and I get the following error msg
>
>Exception in thread "main" java.lang.IllegalArgumentException: Not
>supported: http://icl.com/saxon/feature/sourceParserClass
>         at
>org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFa
>ctoryImpl.java:558)
>         at FormatTranslator.main(FormatTranslator.java:29)


 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]