0

I am getting this error while reading.txt file through XSLT 2.0 -

ERROR:  'Error checking type of the expression 'funcall(unparsed-text, [parameter-ref(text-uri/reference), parameter-ref(text-encoding/reference)])'.'
FATAL ERROR:  'Could not compile StyleSheet'.

Trying to process using javax.xml.transform.Transformer.

Any feedback would be helpful.Thanks.

newuser
  • 7,892
  • 2
  • 23
  • 33
cooper
  • 513
  • 4
  • 8
  • 19
  • 1
    Would it be possible for you to show the XSLT stylesheet you are having problems with. In particular the line calling "unparsed-text". Thanks! – Tim C Aug 29 '13 at 07:19
  • @Tim ,Thanks. Please look at this - http://stackoverflow.com/questions/8205089/is-xslt-good-approach-to-convert-text-to-xml-structure. good example, but .txt is accessed inside xslt. i am trying the same xslt in my java class. – cooper Aug 29 '13 at 07:33
  • @cooper, if you want to use XSLT 2.0 then you need to use an XSLT 2.0 processor like Saxon 9. Are you doing that? Or are you trying to compile an XSLT 2.0 with the Oracle JRE's built-in XSLT processor? That only supports XSLT 1.0. – Martin Honnen Aug 30 '13 at 08:55
  • @Martin, Thanks. Can we avoid passing file path to unparsed-text() as shown in http://stackoverflow.com/questions/8205089/is-xslt-good-approach-to-convert-text-to-xml-structure, in order to pass txt-file path through program. – cooper Sep 04 '13 at 18:07
  • @cooper, an XSLT program can take external parameters, simply put an `` as a top level element, then check the API of your XSLT processor on how to set that parameter from your code (e.g. Java) before running a transformation. – Martin Honnen Sep 05 '13 at 08:52

0 Answers0