Você está na página 1de 2

XML Parser Transformation Transformation type: Active Connected When the Integration Service processes an XML Parser transformation,

it reads a row of XML data, parses the XML, and passes data through output groups. The XML Parser transformation can also return non-XML data in pass-through ports. The XML Parser transformation has one input group and one or more output groups. The input group has one input port, DataInput, which accepts a string data BLOB a s an XML document. When you create an XML Parser transformation, use the XML Wizard to import an XM L, DTD, or XML schema file. For example, you can import the following Employee D TD file: <!ELEMENT EMPLOYEES (EMPLOYEE+)> <!ELEMENT EMPLOYEE (LASTNAME, FIRSTNAME, ADDRESS, PHONE+, EMAIL*, <!ATTLIST EMPLOYEE EMPID CDATA #REQUIRED DEPTID CDATA #REQUIRED> <!ELEMENT LASTNAME (#PCDATA)> <!ELEMENT FIRSTNAME (#PCDATA)> <!ELEMENT <!ELEMENT <!ELEMENT <!ELEMENT <!ELEMENT ADDRESS (STREETADDRESS, CITY, STATE, ZIP)> STREETADDRESS (#PCDATA)> CITY (#PCDATA)> STATE (#PCDATA)> ZIP (#PCDATA)> EMPLOYMENT)>

<!ELEMENT PHONE (#PCDATA)> <!ELEMENT EMAIL (#PCDATA)> <!ELEMENT <!ATTLIST <!ELEMENT <!ELEMENT EMPLOYMENT (DATEOFHIRE, SALARY+)> EMPLOYMENT EMPLSTAT (PF PP TF TP O) "PF"> DATEOFHIRE (#PCDATA)> SALARY (#PCDATA)>

The following figure shows the XML Parser transformation that the Designer creat es from the Employee DTD file:

Streaming XML to the XML Parser Transformation You can configure a session to stream the XML from an Unstructured Data transfor mation, JMS source, or WebSphere MQ source to the XML Parser transformation. Whe n the Integration Service streams XML data, it splits XML data into multiple seg ments. You can configure a smaller input port in the XML Parser transformation a nd reduce the amount of memory that the XML Parser transformation requires to pr ocess large XML files. You can parse XML files that are larger than 100 MB. When you enable XML streaming, the XML Parser transformation receives data in se gments that are less than or equal to the port size. When the XML file is larger than the port size, the Integration Service passes more than one row to the XML Parser transformation. Each XML row has a row type of streaming. The last row h as a row type of insert. The XML Parser transformation input port precision must be equal to or greater t han the output port precision of the transformation or Source Qualifier that is

passing the XML. When most of the XML documents are small, but some messages are large, set the XML Parser transformation port size equal to the size of the sma ller messages for best performance. If you enable XML streaming in the XML Parser transformation, you must also enab le XML streaming for the source or transformation that is passing the XML data t o the XML Parser transformation. If you do not enable streaming, the XML Parser receives the XML in one row, which might slow performance. To enable XML streaming in the XML Parser transformation, select Enable XML Inpu t Streaming in the XML Parser transformation session properties. If you enable X ML streaming in the source or transformation, but you do not enable it for the X ML Parser transformation, the XML Parser transformation cannot process the XML f ile. XML Decimal Datatypes When you define the precision of an XML decimal element to be greater than 34 di gits, the Integration Service calls an external function to convert the XML deci mal datatype to a Double in the XML Parser transformation. The function returns a Double with a precision length that is dependent on the node that is running t he Integration Service. On all platforms, the precision is guaranteed to be 17 d igits before the number is rounded, but the precision might be more on some plat forms. For example, on Windows 32-bit, the Integration Service rounds the number after 17 digits. 1234.567890123456789 is converted to 1234.567890123460800. On HP-UX 32-bit, the Integration Service rounds the number after 34 digits.

Você também pode gostar