Friday, July 11, 2014

XML faqs and answers for EDI

Question 1: What is XML ?
Answer : XML stands for Extensible Markup language which means you can extend XML based upon your needs. You can define custom tags like <books><orders> etc in XML easily as opposed to other mark-up language like HTML where you need to work with predefined tags e.g. <p> and you can not use user defined tag. Though structure of XML can be standardize by making use of DTD and XML Schema. XML is mostly used to transfer data from one system to another e.g. between client and server in enterprise applications.

Question 2: Difference between DTD and XML Schema?
Answer : There are couple of differences between DTD and XML Schema e.g. DTD is not written using XML while XML schema are xml documents in itself, which means existing XML tools like XML parsers can be used to work with XML schema. Also XML schema is designed after DTD and it offer more types to map different types of data in XML documents. On the other hand DTD stands for Document Type definition and was a legacy way to define structure of XML documents.

Question 3: What is XPath ?
Answer : XPath is an XML technology which is used to retrieve element from XML documents. Since XML documents are structured, XPath expression can be used to locate and retrieve elements, attributes or value from XML files. XPath is similar to SQL in terms of retrieving data from XML but it has it's own syntax and rules. See here to know more about How to use XPath to retrieve data from XML documents.

Question 4: What is XSLT?
Answer : XSLT is another popular XML technology to transform one XML file to other XML, HTML or any other format. XSLT is like a language which specifies its own syntax, functions and operator to transform XML documents. Usually transformation is done by XSLT Engine which reads instruction written using XSLT syntax in XML style sheets or XSL files. XSLT also makes extensive use of recursion to perform transformation. One of the popular example of using XSLT is for displaying data present in XML files as HTML pages. XSLT is also very handy to transforming one XML file into another XML document.

Question 5: What is element and attribute in XML?
Answer : This can be best explained by an example. let's see a simple XML snippet

<Orders>
  <Order id="123">
     <Symbol> 6758.T</Symbol>
     <Price> 2300</Price>
  <Order>
<Orders>

In this sample XML id is an attribute of <Order> element. Here <Symbol><Price> and <Orders> are also other elements but they don't have any attribute.

Question 6: What is meaning of well formed XML ?
Answer : Another interesting XML interview question which most appeared in telephonic interviews. A well formed XML means an XML document which is syntactically correct e.g. it has a root element, all open tags are closed properly, attributes are in quotes etc.  If an XML is not well formed, it may not be processed and parsed correctly by various XML parsers.

Question 7: What is XML namespace? Why it's important?
Answer : XML namespace are similar to package in Java and used to provide a way to avoid conflict between two xml tags of same name but different sources. XML namespace is defined using xmlns attribute at top of the XML document and has following syntax  xmlns:prefix="URI". later that prefix is used along with actual tag in XML documents. Here is an example of using XML namespace :


8. What is XML/EDI?
This is the present attempt to combine the best features of traditional EDI (which has a broad industry support) with the improvements in technology offered by XML. It is EDI with XML, or XML with EDI - depending on the perspective.
In an XML/EDI message the EDI information is explicitly labelled using tag names. Reference may be made via Internet to a Document Type Definition (DTD) - which contains structure declaration and relevant sets of code values.
Web browsers are expected to support XML, therefore XML/EDI messages. Like EDI messages, XML/EDI messages could be transmitted in any way: e-mail, VAN, Internet etc.
9. What is XSL?
This is the Extensible Style Sheets Language developed by W3C primarily to control the way information is presented on screen. XSL is used to display the information structured in XML; presentation aspects are dissociated from data structure (unlike HTML which tries to perform both functions). XSL involves the creation of Graphical User Interface (GUI) form objects out of an XML document.
XSL also provides some key document-handling facilities beyond styling. For instance, transformations, re-arrangement of elements, extract of a table of contents from a document.
10. How does XML/EDI relate to forms?
It is expected that for SMEs, web-based forms will be an important mechanism to create and read XML/EDI messages. These forms may be linked to local database systems.
11. Does XML/EDI replace EDIFACT?
The answer is yes and no. Yes, in the long term XML/EDI may replace EDIFACT, at least for some category of partners such as SMEs. However, XML/EDI builds on the EDIFACT foundations in terms of semantic contents (message types, segments and data elements) and related UN code lists. In that sense, it opens new opportunities for EDIFACT. For more information on EDIFACT see <www.unece.org/trade/untdid>.

No comments:

Post a Comment

Introducing a rate limiter feature in IBM Sterling Integrator allows for comprehensive API functionality without the need to invest in additional API tools.

To activate and integrate the rate limiter feature in Sterling Integrator for comprehensive API functionality, follow these steps. To ...