XML.HTMLTeacher.Com
[Search] [Contact] [Sitemap]
XML
[Main]
[XML]
[Inserting HTML into XML]
[Classes]
[XHTML]
[XML]
[CSS]
[Design]
[Programming]
[Marketing]

The XML Document
<?xml version="1.0" ?>

<?xml-stylesheet type="text/css" href="inserthtmlpicture.css"?>

<vacation>
<pictures>
<title>The Mountains</title>

<place>
<html:a xmlns:html="http://www.xml.htmlteacher.com/anchors" href="http://www.colorado.gov/">
Colorado
</html:a>
</place>

<html:img xmlns:html="http://www.xml.htmlteacher.com/images" src="photo.jpg" />

<date>August 2002</date>
</pictures>
</vacation>

The Linked CSS file

Result:
Formatted HTML/XML file

* When formatting an XML document for the web, you may wish to insert an anchor or image element. XML has a specification for linking called XLink. However, XLink is not currently supported by Internet Explorer 6 and Netscape 6 supports only simple links at this time.

See the markup in red in the above example for the html elements.

* Although not yet supported without a browser plug-in, SVG (Scalable Vector Graphics) will provide support for images within XML documents. Please see the Adobe website for more information.

* Namespaces are the reason for the support of HTML elements within an XML document.

See the markup in green in the above example for the namespace URI that is preceded by xmlns:html and the namespace prefix of html preceding the html elements.

* In order for the XML document to be transformed into a viewable formatted document for the web, a CSS stylesheet must be linked to the XML document.

See the markup in purple in the above example for the stylesheet link.


All materials, tutorials and content are copyrighted by HTMLTeacher.Com.
Any use of any material, tutorials and/or content provided by this site is prohibited without expressed written consent of the author.

Copyright ©2003 HTMLTeacher.Com and Sonia Weimann