We can embed some kind of files like audio flash etc. And the same, we can
embed and XML file and this is happen with <xml> element. Process of
this file ambition is called XML Data Island. In this
procedure we will use an external XML document and use it as we use the
CSS and
XSL. For example we have following XML document.
Now and other
HTML file will use the above Employees XML. In
HTML we
will use <xml> tag to define an XML Data Island and for this purpose we have two
attributes in HTML <xml> tag, one is its id and second is its source, as we use
a source of any
CSS or
XSL. ID attribute will be use in other
HTML tags to
retrieve data from XML document To retrieve data we will bind the ID
of xml tag to the
HTML tags as shown in below example of
HTML.
On the above
HTML code
we can see that we have first created an id of XML document with the <xml> tag and
define its source file with an attribute of "src" then we start a table and bind
it with its an attribute of "datasrc". This attribute will bound the
entire data of XML document with
HTML table and for display it we again need to specify each
element of XML document that's why we use the <span> tag in table <td>, table
<td> tag have no any attribute to bind itself with XML data so we used span tag
and the span tag have an attribute of "datafld" to specify Data Field we will
use this attributes as we know in our Employees XML we have three elements FirstName LastName and gender that's why we have used three <span> tags and bind
them with one by one XML elements. For more details you can click here for
HTML document and
see its view source, here you will see how to make more formatting with XML Data
Island and express it as good as you can. Look a external Employees
XML document here.
If
you are using Mozilla Firefox or other browsers except Microsoft Internet
Explorer
then the output for some examples could not visible but when you try to view
source you can see the entire Source for that example and to get full out put we
recommend you to please view these examples in Microsoft Internet Explorer and
it is better to use IE version 5.5 or 6 is recommended for the best output.