* @param rootElementURI the Target Namespace URI of the root XML element
* @param rootElementName the Name of the root XML element
* @return XMLDocument a new XMLDocument set with the specified parameters.
*/
public XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName) {
SDOXMLDocument document = new SDOXMLDocument();
document.setRootObject(dataObject);
document.setRootElementURI(rootElementURI);
if (rootElementName != null) {
document.setRootElementName(rootElementName);
}
Property globalProp = getHelperContext().getXSDHelper().getGlobalProperty(rootElementURI, rootElementName, true);
if (null != globalProp) {
document.setSchemaType(((SDOType) globalProp.getType()).getXsdType());
}
document.setEncoding(SDOXMLDocument.DEFAULT_XML_ENCODING);
document.setXMLVersion(SDOXMLDocument.DEFAULT_XML_VERSION);
return document;
}