aspose file tools*
The moose likes XML and Related Technologies and the fly likes Using FOP on Linux and getting XSL formatting error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Using FOP on Linux and getting XSL formatting error" Watch "Using FOP on Linux and getting XSL formatting error" New topic
Author

Using FOP on Linux and getting XSL formatting error

Guyle McClellan
Greenhorn

Joined: Jun 20, 2012
Posts: 2
I'm trying to use FOP to generate PDF output using XML data and an XSL stylesheet. With one different version of the XSL things work fine, but when I use my primary XSL stylesheet, I get the error shown below:

---------
; Line#: 18; Column#: 47
; Line#: 18; Column#: 47
javax.xml.transform.TransformerException: A location path was expected, but the following token was encountered: \

There doesn't seem to be anything obviously wrong syntactically with my XSL file, but I'm baffled about where the formatting glitch is located. Can anyone help me me identify where the problem lies in this XML file?

An excerpt (including line 18) is shown below.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

A quick scan for the offending backslash character leads directly to this line of code:



And there it is. Those backslashes aren't valid in an XPath expression.

There are several other lines like that with a similar error.
Guyle McClellan
Greenhorn

Joined: Jun 20, 2012
Posts: 2
Fantastic. That was it! In my other XSL file, those backslashes were not present. Huge thanks Paul.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

You're welcome. And by the way, welcome to the Ranch!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using FOP on Linux and getting XSL formatting error