The following is an example of using XItemFactory to create
a homogeneous sequence.
// Create an XFactory
XFactory factory = XFactory.newInstance();
// Create an XItemXFactory
XItemFactory itemFactory =xfactory.getItemFactory();
//Create a sequence of int values
XSequenceCursor intSeq = xfactory.sequence(new int[]{1,2,3});
//Create a sequence of String values
XSequenceCursor stringSeq = xfactory.sequence(new String[]{"This", "is", "a", "test"},XTypeConstants.STRING_QNAME );
The
following is an example of using the XItemFactory to create a sequence
of items of different types.
// Create an XFactory
XFactory factory = XFactory.newInstance();
// Create an XItemXFactory
XItemFactory itemFactory = factory.getItemFactory();
//Create an Array of the newly created items
XItemView[] items = new XItemView[2];
items[0] =itemFactory.item(boolValue, XTypeConstants.BOOLEAN_QNAME);
items[1] = itemFactory.item(intValue, XTypeConstants.INT_QNAME);
// Create a sequence of items
XSequenceCursor seq = itemFactory.sequence(items);