cleanseXMLEx() - trillium_quality - 17.2

Trillium Director SDK Reference Guide

Product type
Software
Portfolio
Verify
Product family
Trillium
Product
Trillium > Trillium Quality
Version
17.2
Language
English
Product name
Trillium Quality
Title
Trillium Director SDK Reference Guide
Topic type
Overview
Administration
Configuration
Installation
Reference
How Do I
First publish date
2008

The cleanseXMLEx() method combines the attach(), cleanseXML() and release() methods into a single method. Use this method in a real-time environment when you want to process only one record at a time. This method performs the attach and release of a cleansing server and therefore, relieves the developer from explicitly calling the attach() and release() methods.

Note: Use of this method requires a special configuration file to define the format of the XML document. Use the TRILLCONFIG environment variable to point to this configuration file.

Syntax

public void cleanseXMLEx(char systemID,
                        java.lang.String serverName,
                        java.lang.String rootTag,
                        java.lang.String inputXML,
                        java.lang.StringBuffer outputXML,
                        int retCode[]);

Parameters

Name

Type

Use

Length

Description

systemID

int

In

1

System ID of the requested server.

serverName

string

In

1-8

Server name of the requested server.

rootTag

string[ ]

In

n*

XML root tag.

inputXML   

string[ ]

In

n*

XML string containing the data to be cleansed.

outputXML

string[ ]

Out

n*

StringBuffer where the cleansed XML is returned.

retCode

int[ ]

Out

4

Error code that indicates status of method call.

n* indicates the platform-specific length which varies depending on the hardware and operating system on which the program runs.

Example

TrTrilTGenClient testClient = new TrilTGenClient();

// Return code
int[] retCode= new int[1];

// System and Server ID for attach()
char systemID = 'G';
String serverName = "Cleanser";

// Root Tag of XML doc
String rootTag = "CustomerData/PrimaryCustomer/Address";

// This is the input (dirty) XML doc

String inputXML =
"<?xml version = '1.0' encoding = 'ISO-8859-1' standalone = 'no'?>" +
"<CustomerData>" +
    "<REQUESTTYPE>Cleanse</REQUESTTYPE>" +
    "<PrimaryCustomer>" +
        "<Name>John Smith</Name>" +
        "<Address>" +
            "<StreetLine1>11 falk</StreetLine1>" +
            "<StreetLine2 />" +
            "<City>pompton lakes</City>" +
            "<State>NJ</State>" +
            "<Country>US</Country>" +
            "<ZipCode></ZipCode>" +
      "</Address>" +
    "</PrimaryCustomer>" +
"</CustomerData> "

// Allocate StringBuffer to receive clean XML
StringBuffer outputXML = new StringBuffer ("");

testClient.cleanseXMLEx(systemId, server Name,rootTag, inputXML, outputXML,
retCode);
  if (retCode[0] != 0) {
  System.out.println("cleanseXMLEx method returned" + retCode[0]);
  } else {
// Do something with cleansed data that is in outputXML
}