Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-1002

document() function not working if xsl templates loaded from a byte stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 2.0.0
    • None
    • None
    • Operating System: Windows NT/2K
      Platform: PC
    • 9018

    Description

      I'm not sure if this is a bug or just a misunderstanding on my part but any
      help would be appreciated.

      I have made a small modification to my copy of org.apache.xalan.xslt.Process so
      that it reads in the xsl template and then decrypts it before processing.

      See following code fragment. The else part is what it used to do.

      // Handles encrypted .xok files and non-encrypted .xsl files
      if (xslFileName.endsWith(".xok"))
      {
      InputStream in = new FileInputStream(xslFileName);

      java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream();

      // Decrypt the file
      int index = 0;
      while(in.available() > 0)

      { out.write(OktEncrypt.decrypt(in.read(), index)); index++; }

      stylesheet = tfactory.newTemplates(new StreamSource(new
      java.io.ByteArrayInputStream(out.toByteArray())));
      }
      else
      stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));

      So basically the only difference is that the templates are loaded from memory
      instead of directly from a file.

      What I am finding is that if I use the document() function in my xsl to read in
      another XML file then it doesn't seem to work at all. I am calling it with an
      absolute path C:\xxx

      I would have thought this would still work. Any suggestions as to why it
      doesn't?

      Thanks, Damon

      Attachments

        Activity

          People

            Unassigned Unassigned
            dhorrell@oktobor.com Damon Horrell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: