XML in HTML

NCD HTML Design Guide v6.0


Sponsor's ADs:

+ Custom Tag

Declaring a XML Namespace
<html xmlns:#>...</html>
      #=namespace


Declaring a Tag name and Style
<style> #\:TAG {Style-Declaration} </style>
      #=namespace, TAG=custom tag name


Use Custom Tag
<#:TAG>...</#:TAG>
      #=namespace, TAG=custom tag name


<HTML XMLNS:TEST>
<HEAD>
<STYLE>
    TEST\:RED {color:red}
</STYLE>
</HEAD>
<BODY>
<H1>Custom Tag Test</H1>
<TEST:RED>This text will be a red color.</TEST:RED>
</BODY>
</HTML>
View This Sample


+ Inline XML

XML data can be included in an HTML document to script against it.
Nothing will happen without scripting.

<xml ID=#> ..xml data.. </xml>

ex.
<XML ID="SAMP"> <member> <name>Netwrok Communication Design</name> <email>msg@ncdesign.org</email> </member> </XML> <INPUT TYPE=button VALUE="Member Name" onClick="alert(SAMP.XMLDocument.documentElement.childNodes.item(0).text)"> <INPUT TYPE=button VALUE="E-Mail Address" onClick="alert(SAMP.XMLDocument.documentElement.childNodes.item(1).text)">
Netwrok Communication Design msg@ncdesign.org


<script language="xml" ID=#>
..xml data..
</script>

ex.
<SCRIPT LANGUAGE="xml" ID="SAMP1"> <member> <name>NCDESIGN</name> <email>Not Available</email> </member> </SCRIPT> <INPUT TYPE=button VALUE="Member Name" onClick="alert(SAMP1.XMLDocument.documentElement.childNodes.item(0).text)"> <INPUT TYPE=button VALUE="E-Mail Address" onClick="alert(SAMP1.XMLDocument.documentElement.childNodes.item(1).text)">


+ Linking XML

<xml ID=# src=#></xml>

ex.
<XML ID="SAMP2" SRC="samp/sample.xml"></XML> <INPUT TYPE=button VALUE="Member Name" onClick="alert(SAMP2.XMLDocument.documentElement.childNodes.item(0).text)"> <INPUT TYPE=button VALUE="E-Mail Address" onClick="alert(SAMP2.XMLDocument.documentElement.childNodes.item(1).text)">




HTML Design Guide | Style Sheet Guide
Document | Page | Font | Text | Image | Form | Table | Frame | Objects | XML
HTML TAG LIST | PDF Edition


BACK TO NCD HOME
Network Communication Design - /
Copyright & Publishing 1994-2008 Network Communication Design