IzPack安装程序,无法找到元素安装的声明

时间:2016-05-20 06:14:51

标签: java xml installer izpack

编译install.xml时出现此错误

ERROR:  'cvc-elt.1: Cannot find the declaration of element 'installation'.'
ERROR:  'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: cvc-elt.
1: Cannot find the declaration of element 'installation'.'
-> Fatal error :
   Error in C:\IzPack\bin\install.xml at line 2, column 29 : javax.xml.transform
.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeExcep
tion: cvc-elt.1: Cannot find the declaration of element 'installation'.

我的install.xml是

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
  <info>
    <appname>Test</appname>
    <appversion>1</appversion>
  </info>
  <guiprefs width="600" height="480" resizable="no">
  </guiprefs>
  <locale>
    <langpack iso3="eng"/>
  </locale>
  <panels>
    <panel classname="ShortcutPanel"/>
  </panels>
  <packs>
    <pack name="Test" required="yes">
      <description>Description</description>
    </pack>
  </packs>
  <resources>
    <res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
  </resources>
  <native type="izpack" name="ShellLink.dll"/>
</installation>

我无法编译install.xml。我做错了什么?

我正在使用IzPack 5.0.8

1 个答案:

答案 0 :(得分:5)

在文档中没有明确但

转移到:

public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {

    private ArrayList<Comments> mDataSet;


    // Provide a reference to the views for each data item
    // Complex data items may need more than one view per item, and
    // you provide access to all the views for a data item in a view holder
    public class ViewHolder extends RecyclerView.ViewHolder {
        // each data item is just a string in this case
        protected ImageView userAvatar;
        protected TextView userID;
        protected TextView userComment;

        public ViewHolder(View v) {
            super(v);
            userAvatar = (ImageView) v.findViewById(R.id.profile_image);
            userID = (TextView) v.findViewById(R.id.user_ID);
            userComment = (TextView) v.findViewById(R.id.user_comment_textview);
        }
    }

    // Provide a suitable constructor (depends on the kind of dataset)
    public MyAdapter(ArrayList<Comments> myDataset) {
        mDataSet = myDataset;
    }

    // Create new views (invoked by the layout manager)
    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent,
                                                   int viewType) {
        // create a new view
        View v = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.individual_comment, parent, false);
        // set the view's size, margins, paddings and layout parameters
        return new ViewHolder(v);
    }

    // Replace the contents of a view (invoked by the layout manager)

    //The OutOfBoundsException is pointing here
    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        Comments comment = mDataSet.get(position);
        holder.userComment.setText(comment.getUserComment());
        holder.userID.setText("User " + position);
    }


    // Return the size of your dataset (invoked by the layout manager)
    @Override
    public int getItemCount() {
        return mDataSet.size();
    }
}

为我修好了。