You are here: Reference > HTML > tags > xml

xml element

Browser support:
Defines XML data content in a HTML page.
The xml element allows authors to insert XML content directly into the document.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: xml.

Possible members:

Attributes
Events
Styles
id
Sets a unique identifier for the object.
language
Sets the scripting language for the current element. Use it only for the script element.
src
Sets the location of an associated file for an object.

Example HTML code 1:

This example illustrates the use of the xml element:
<xml>
  <fruits>
     <apple>$5</apple>
     <pear>$10.50</pear>
     <peach>$23.30</peach>
  </fruits>
</xml>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to use the xml element to create a dynamic table in Internet Explorer:
<head>
    <xml id="movies">
        <?xml version="1.0"?>
        <movies>
            <movie>
                <name>Clark Kent</name>
                <jobtitle>Superman</jobtitle>
                <born>1966</born>
            </movie>
            <movie>
                <name>Lois Lane</name>
                <jobtitle>Reporter</jobtitle>
                <born>1964</born>
            </movie>
            <movie>
                <name>Fred Flintstone</name>
                <jobtitle>Caveman</jobtitle>
                <born>1970</born>
            </movie>
            <movie>
                <name>Barney Rubble</name>
                <jobtitle>Caveman</jobtitle>
                <born>1972</born>
            </movie>
        </movies>
    </xml>
</head>
<body>
    <table width="100%" cellpadding="0px" cellspacing="2px" border="1px" datasrc="#movies" datapagesize="1" id="myTable">
        <thead>
            <tr>
                <th>Name</th>
                <th>Jobtitle</th>
                <th>Born</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><span datafld="name"></span></td>
                <td><span datafld="jobtitle"></span></td>
                <td><span datafld="born"></span></td>
            </tr>
        </tbody>
    </table>

    <input type="button" onclick="myTable.firstPage ()" value="|< First " />
    <input type="button" onclick="myTable.previousPage ()" value="< Previous " />
    <input type="button" onclick="myTable.nextPage ()" value=" Next >" />
    <input type="button" onclick="myTable.lastPage ()" value=" Last >|" />
</body>
Did you find this example helpful? yes no

External links:

User Contributed Comments

Post Content

Post Content