This project is read-only.

xsl stylesheet


Hi everyone!
Is it not possible to use xsl stylesheets with
I'm getting the following Exception when I try to run the code snippet below. (xslt file is attached)
{"System.SystemException: Unknown formatting object^stylesheet\r\n at Fonet.FonetDriver.FireFonetError(String message)\r\n at Fonet.Fo.FOTreeBuilder.StartElement(String uri, String localName, Attributes attlist)\r\n at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)"}
class TestPDFGenerator
static void Main(string[] args)
    FonetDriver driver = FonetDriver.Make();
    string foPath = "helloWorld.xslt";
    StringBuilder foContent;
    if (!File.Exists(foPath))
         throw new FileNotFoundException(string.Format("{0} file doesn't exists.", foPath));
    using (TextReader textReader = new StreamReader(foPath))
        foContent = new StringBuilder(textReader.ReadToEnd());
    string path = "D:\\hello.pdf";
    using (FileStream fs = File.Create(path))
          driver.Render(new MemoryStream(Encoding.ASCII.GetBytes(foContent.ToString())), fs);

file attachments


griffm wrote Jan 18, 2012 at 8:05 PM

Hi Ozan

I don't want to come across as abrupt or rude, but I think that you need to take a step back and research the difference between XSLT and XSL:FO. Then read the doc comments in the FonetDriver class. After that I think all will become clear.


ozansan wrote Jan 25, 2012 at 2:26 PM

Hi Mark,

thanks, it's all clear now. fonet is just for xsl-fo and I know now xsl-fo and xslt are not same :)


wrote Feb 22, 2013 at 12:01 AM

pushpa1029 wrote Jan 27, 2014 at 12:12 PM

Hi Ozan,

I am getting below exception while i am using htmkl tags in XSL-Fo.

System.SystemException: Unknown formatting object ^html
at Fonet.FonetDriver.FireFonetError(String message)
at Fonet.Fo.FOTreeBuilder.StartElement(String uri, String localName, Attributes attlist)
at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)

any help?