IzPack

It appears that the "parsexml" resource attribute support does not read the resource that is to be parsed

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.11.0
  • Fix Version/s: 4.0.0
  • Component/s: Compiler
  • Labels:
    None
  • Environment:
    Windows Vista Home Premium
  • Number of attachments :
    1

Description

I tried to use the "parsexml" attribute of the resource tag as follows:

        <res id="userInputSpec.xml" src="userinput.xml" parsexml="yes"/>

and in "userinput.xml", I have:

    <userInput>
        <xinclude href="glassfish/userinput.xml" parse="xml"/>
    </userInput>

and in "glassfish/userinput.xml" I have:

   <xfragment>
       <panel order="0">
       ...
   </xfragmen>

When I compile the project, the compiler give an error such as:

   -> Fatal error :
       install.xml:58: Invalid input: `?' (0xffff), SystemID='file:/C:/Users/brett/AppData/Local/Temp/izpp59850.tmp', Line=1
com.izforge.izpack.compiler.CompilerException: install.xml:58: Invalid input: `?' (0xffff), SystemID='file:/C:/Users/brett/AppData/Local/Temp/izpp59850.tmp', Line=1
        at com.izforge.izpack.compiler.CompilerConfig.parseError(CompilerConfig.java:1915)
        at com.izforge.izpack.compiler.CompilerConfig.addResources(CompilerConfig.java:1382)

If I check the referenced file "file:/C:/Users/brett/AppData/Local/Temp/izpp59850.tmp" it is completely empty. Looking at the source code of CompilerConfig.java, I don't see anything that is ever writing to the referenced file before it is parsed. At line 1333, I see the line:

                    IXMLReader reader = new StdXMLReader(null, url.toExternalForm());

This is trying to setup an XML reader on the temporary file. If I change this to:

                    IXMLReader reader = new StdXMLReader(null, originalUrl.toExternalForm());

then the code compiles fine and the included XML referenced by the "xinclude" is correctly included in "userInputSpec.xml".

Activity

Hide
Julien Ponge added a comment -

Thanks for reporting. Can you please attach a patch to this issue?

I know that you have described a fix, but having a patch makes it easier for everyone to review

Show
Julien Ponge added a comment - Thanks for reporting. Can you please attach a patch to this issue? I know that you have described a fix, but having a patch makes it easier for everyone to review
Hide
Brett Bergquist added a comment -

Here is the patch for this problem.

Show
Brett Bergquist added a comment - Here is the patch for this problem.
Hide
Julien Ponge added a comment -

Just merged your patch, thanks a lot!

Show
Julien Ponge added a comment - Just merged your patch, thanks a lot!
Hide
Julien Ponge added a comment -

Closing resolved issues (they should not stay "resolved" but get closed)

Show
Julien Ponge added a comment - Closing resolved issues (they should not stay "resolved" but get closed)

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: