XML With Informatica

13
XML & XML with Informatica

Transcript of XML With Informatica

XML & XML with Informatica

XML My best description of XML is this: XML is a cross-platform, software and hardware independent tool for transmitting information. XML is used to Exchange Data With XML, data can be exchanged between incompatible systems. In the real world, computer systems and databases contain data in incompatible formats. One of the most time-consuming challenges for developers has been to exchange data between such systems over the Internet. Converting the data to XML can greatly reduce this complexity and create data that can be read by many different types of applications. XML, DTD, and XML Schema Extensible Markup Language (XML) is a markup language generally regarded as the universal format for structured documents and data on the Web. Like HTML, XML contains element tags and attributes that define data. Unlike HTML, XML element tags and attributes are not based on a predefined, static set of elements and attributes. Every XML file can have a different set of tags and attributes. Document Type Definition (DTD) files and XML schema files define the elements and attribute that can be used and the structure within which they fit in an XML file. DTD and XML schema files specify the structure and content of XML files in different ways. A DTD file defines the names of elements, the number of times they occur, and how they fit together. The XML schema file provides the same information plus the data types of the elements. DTD The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. A DTD can be declared inline in your XML document, or as an external reference. The DTD file contains only metadata. It contains the description of the structure and the definition of the elements and attributes that can be found in the associated XML file. It does not contain any data. A sample DTD looks like this:

eg: < companyname > 01 Wipro Technologies < employee > 91000 Dileep 25 Male Project Engineer 20000 XML Schema The XML schema file, like the DTD file, contains only metadata. In addition to the definition and structure of elements and attributes, an XML schema contains a description of the type of elements and attributes found in the associated XML file. A sample XML Schema file looks like this:

eg: 00996 Testing 00896 Test Cardinality in XML: Declaring only one occurrence of the same element (only once) (For DTD) (For Schema file) Declaring minimum one occurrence of the same element (one or more) (For DTD) (For Schema file) or (For Schema file) Declaring zero or more occurrences of the same element (zero or more)

(For Schema file) or (For Schema file) Declaring zero or one occurrences of the same element (zero or one) (For Schema file)

XML Entity References An entity reference is a group of characters used in text as a substitute for a single specific character that is also a markup delimiter in XML. Using the entity reference prevents a literal character from being mistaken for a markup delimiter For example, if an attribute must contain a left angle bracket ( " ' Entity reference & < > " ' Numeric reference & < > " ' Hexadecimal reference & < > " '

Character data: Character data can be either a PCDATA or a CDATA in XML. PCDATA PCDATA means parsed character data. i.e. if we have a character data element declared as PCDATA then all characters or text or data inside the xml tags will be parsed by the XML parser. In this type of data, if we place a character like "