Wednesday, January 10, 2007

Informatica 7.1: XML file as Source

What is a DTD

A DTD file contains metadata only.It contains the structure and the definitions of the elements and attributes which can be found in the main xml.

What is a XSD
Good basic tutorial is in W3Schools:-Introduction to XML Schema
XML namespace identifies a group of similar kind of elements belongs together.

What is the basic difference between XSD and DTD?

* DTD's are not namespace aware.

DTD's have #define, #include, and #ifdef -- or, less C-oriented,
the ability to define shorthand abbreviations, external content,
and some conditional parsing.

A DTD describes the entire XML document (even if it leaves "holes");
a schema can define portions.

XSD has a type system.

XSD has a much richer language for describing what element or attribute
content "looks like." This is related to the type system.

You can put a DTD inline into an XML document, you cannot do this with
XSD. This means DTD's are more secure (you only have to protect one
bytestream -- the xml/dtd -- and not multiple).

The official definition of "valid XML" requires a DTD. Since this may
be impractical, if not impossible, you often have to settle for
schema-valid, which is not quite the same.

In terms of validation functionality, XSD can define all the constraints that a DTD can define, and many more. To take a simple example, XSD can say that a particular attribute must be a valid date, or a number, or a list of URIs, or a string that is exactly 8 characters long. To take another example, XSD can define much richer constraints on uniqueness of values within a document.So
XSD provides much more control over the XML then DTD.

Can we supply a XML file having no XSD or DTD associated with it as source?


- Yes.In that case designer will read the tags for the elements,reads each element to determine their datatype and precision,their possible occurences and their position in the hierarchy.

* Mapping designer can create source qualifier from XSD/DTD supplied with the XML file.
* But this determining takes long time if the source XML is large.So its always better to have a XSD or DTD ( internal/external ) associated with that XML.
* Mapping designer can be configured to validate the input XML file as per as the supplied XSD or DTD.

What does "sequence" mean in a complex type XSD?

XSD can be of two types:-
o> Simple type XSD: Having one element inside it only.
Check XSD Simple Elements
o> Complex type XSD: Having more than one element inside that.
Check XSD Complex Elements

Whatever elements have been described inside sequence they should be in the same order in the XML file.

Check the example Check the person element

Sequence is one kind of indicator to tell the XML file how it should have elements in it,in which sequences,how many times a element may occur,are the elements/atrtributes going to appear in the XML as a group or not.

Check XSD Complex Types Indicators


What do you mean by "element type any"?


The "anyAttribute" element enables us to extend the XML document with attributes not specified by the schema.

In that case the XML file may get some more attributes from other XSD except the main XSD associated with it.

Check an example from Wschools
anyAttribute


What is pivoting in INFA?


Sometimes in the source XML we have mulitiple occurence of same elements.Like as in customer.xml file there may be two sets of address for each customer;one for home address another for office address.So in that case we wish to have two different channels towards our target in mapping.So we do pivoting in that case.



---: I am not responsible for any damages happened from the suggestion of my blog :---
Reach me at : m.a.hasim@inbox.com

Labels:

0 Comments:

Post a Comment

<< Home