Hello,

I want to create some XML with Java Beans. I generated the classes from my WSDL and it works quite fine. But I have a small problem. My XML-File should look like this:
Java Code:
<Write xmlns="web-adress1" xmlns:xsi="web-adress2" xmlns:xsd="web-adress3">
	<Options/>
	<ItemList>
 	    <Items ItemName=\"S7:[DEMO]TestIntZwei\">
    		<Value xsi:type=\"xsd:short\">87</Value>
  	    </Items>
	</ItemList>
</Write>
My code to generate this file:
Java Code:
WriteDocument doc = WriteDocument.Factory.newInstance();
org.opcfoundation.webservices.xmlda._1_0.WriteDocument.Write write = doc.addNewWrite();
XmlCursor cursor = write.newCursor();
cursor.toEndToken();
cursor.insertNamespace( "xsi", "web-adress2" );
cursor.insertNamespace( "xsd", "web-adress3" );
			
ItemValue item = ItemValue.Factory.newInstance();
item.setItemName( "S7:[DEMO]TestVar" );
// some code to create the value
This code creats the following XML:
Java Code:
<Write xmlns:xsi="web-adress2" xmlns:xsd="web-adress3" xmlns="web-adress1">
  <Options/>
  <ItemList>
    <Items ItemName="S7:[DEMO]TestVar"/>
  </ItemList>
</Write>
I have tried a lot to create a "correct" value-entry, but it was not possible. For example:
Java Code:
XmlObject value = XmlObject.Factory.parse( "<Value xsi:type=\"xsd:short\">87</Value>" );

// or
XmlCursor cursor = value.newCursor();
cursor.beginElement( "Value" );
cursor.toNextToken();
cursor.insertAttributeWithValue( "xsi:type", "xsd:short" );
...
The first solution returns
Java Code:
<Value xsi:type="xsd:short" xmlns:xsi="xsi">87</Value>
Second solution throws an error that the name is not valid. Do you have any ideas about it? Thanks