定义属性时,“panel需要属性id”

时间:2015-05-27 18:09:51

标签: xml izpack

我正在尝试解决Windows上的izpack安装程序问题。第一步是从xml定义到安装程序,但是izpack一直在抱怨<panel> requires attribute 'id'这里是相关部分:我有面板的id和适当的资源,这个文件为另一个用户编译(使用旧版本)版本的izpack)

编辑:尽管错误名称,izpack在尝试解析资源部分时抱怨发生的事情。

<resources>
    <!-- <res id="ImagePanel.img" src="installscreen.jpg"/> -->
    <res id="HTMLHelloPanel.splash" src="./InstallHTML/splash.html"/>
    <res id="LicencePanel.licence" src="Licence.txt"/>
    <res id="HTMLInfoPanel.info" src="./InstallHTML/WindowsInstall_eng.html"/>
    <!-- localization of the info panel -->
    <res id="HTMLInfoPanel.info_fra" src="./InstallHTML/WindowsInstall_fra.html"/>
    <res id="HTMLInfoPanel.info_eng" src="./InstallHTML/WindowsInstall_eng.html"/>
    <res id="HTMLInfoPanel.info_deu" src="./InstallHTML/WindowsInstall_deu.html"/>
    <res id="userInputSpec.xml" src="userInputSpec.xml"/>
    <!--Everything is parsed to this point. The tag below gets choked on -->
    <res id="TargetPanel.dir.windows" src="TargetDir.txt"/>
    <!-- localization of the info panel -->
    <res id="userInputLang.xml_eng" src="userInputLang.xml_eng"/>
    <res id="userInputLang.xml_fra" src="userInputLang.xml_fra"/>
    <res id="userInputLang.xml_deu" src="userInputLang.xml_deu"/>
    <res id="ShortCutPanel.shortcutSpec" src="shortcutSpec.xml"/> 
    <res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
    <!-- localization of resource strings -->
    <res id="packsLang.xml_fra" src="packsLang.xml_fra"/>
    <res id="packsLang.xml_eng" src="packsLang.xml_eng"/>
    <res id="packsLang.xml_deu" src="packsLang.xml_deu"/>
</resources>
<!-- The panels section. We indicate here which panels we want to use. The order will be respected. -->
<panels>
    <panel classname="HTMLHelloPanel" id="splash"/>

    <panel classname="HTMLInfoPanel" id="info"/>
    <panel classname="LicencePanel" id="licence"/>
    <panel classname="TargetPanel" id="dir.windows"/> 
    <panel classname="PacksPanel"/>
    <panel classname="InstallPanel"/>
    <panel classname="ShortCutPanel" id="shortcutSpec"/>

</panels>

我正在使用izpack 5.0快照。

我没有创建这个文件,它有点遗留,最初设置它的人不再使用该项目了。简短版本:该标签与其他标签无效/不同?

编辑:在有人指出之前,PackPanel和LicencePanel对我可以告诉的ID没有任何用处。我还尝试评论除了其中一个列出了ID的面板之外的所有面板,但仍然会出现同样的错误。

2 个答案:

答案 0 :(得分:1)

Per izpack documentation版本5.0与先前版本之间存在不兼容性。它们不是从文本资源中解析默认安装目标,而是定义为变量。不知道为什么这个特殊的例外会出现这种格式错误。

上述的正确实施是 替换此项目:

<res id="TargetPanel.dir.windows" src="TargetDir.txt"/>

使用此:(在资源列表之外)

<variables>
    <variable name="TargetPanel.dir.windows" value="${$USER_HOME}/Programs/ArtOfIllusion"/>
</variables>

目标小组是:

<panel classname="TargetPanel"/>

答案 1 :(得分:-1)

我遇到了类似的问题。注释掉UserInputSpec.xml确实允许它进行编译。即使在该文件中,我也在panel标签中定义了id属性。不知道为什么它仍然给出错误。

编辑:您需要确保UserInputSpec.xml中的id属性与UserInputPanel的面板ID匹配:

<userInput>
 <panel id="mypanel">
 ...

另外请确保您的文件名是UserInputSpec.xml,在我的情况下,我正在调用该文件:)