In this process,
a number of other auxiliary constructs have grown to display (XSL), and query
(XPATH: XML Path language) XML documents. XMLTask in SSIS can carry out
a number of tasks, and this chapter describes two of them in detail.
In this exercise, we will compare two XML documents using XMLTask, as simple
comparison of text will not yield the differences correctly. We will also use XML task
to convert an XML document to an HTML document containing the same data, but
formatted in a prettier way to be viewed in a browser.
In XMLTask, you can carry out a number of tasks, which are discussed in the
following sections:
Diff
When you want to compare two XML documents, and find differences between
them, you can use this type. The result will be written to a third XML document
called XMLDiffGram.
The manner in which differences between two XML files are found is based on the
operation type, Diff, in XMLTask. There are three ways of doing this??”Auto, Fast, or
Precise. Precise is accurate, and uses the Zhang-Sasha algorithm, where distance
between trees in files is used, but is not a fast process. Fast is quick, but not precise.
Creating a SSIS Package with an XML Task
[ 176 ]
It searches node-by-node to find the changes. Using Auto, the program chooses
either Precise or Fast, depending on how the internals of XMLTask evaluate,
assuming the size and extent of changes.
Merge
You can merge two XML documents and in fact you can even tell where in the first
document you want the second to be merged.
Pages:
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133