Skip Headers
Oracle® Communications Design Studio Modeling Activation
Release 7.2.4
Go to Design Studio Help Home
Go to Table of Contents
Go to Feedback page

Go to previous page
Go to next page
Mobi · ePub

Loading XML String Parameter into XML Related Technologies

The autogenerated code produces content in string format for all parameter types including the XML run-time parameter type. However, some network elements require different XML technologies such as document object model (DOM), simple API for XML (SAX), XML beans, and so on. You can create Java code to perform this conversion.

For example, the following sample code loads an XML string parameter into a XML DOM parameter:

public Document buildDocumentFromString(String xmlString)
throws Exception
{
try
{
StringReader stringReader = new StringReader(xmlString);
 
SAXBuilder builder = new SAXBuilder();
 
Diagnosis.diag(1, this, "Building document for :\n" + xmlString);
Document doc = builder.build(stringReader);
return doc;
}
catch (Exception e) {
String exceptionMessage = "Exception caught : " + e.toString();
Diagnosis.diag(1, this, exceptionMessage);
throw new Exception("XML Error" + exceptionMessage);
}
}

Related Topics

Understanding the Java Processor Class

Working with the Action Processor

Modeling Entities

Creating Model Elements

Creating Activation Run-Time Type Parameters in the Data Dictionary

Understanding Model Element Relationships

Understanding Java Libraries in Design Studio

Understanding Unit Testing

Working with User-Defined Exit Types