⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dom_nodes.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>XML DOM - Nodes</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>
<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>


<h1>XML DOM Nodes</h1>

<a href="dom_intro.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_nodetree.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>
<hr />

<p class="intro">In the DOM, everything in an XML document is a node.</p>

<hr />

<h2>DOM Nodes</h2>

<p>According to the DOM, everything in an XML document is a <b>node</b>.</p>
<p>The DOM says:</p>
<ul>
	<li>The 
entire document is a document node</li>
	<li>Every XML element is an element node</li>
	<li>The text in the XML elements are text 
nodes</li>
	<li>Every attribute is an attribute node</li>
	<li>Comments are comment nodes</li>
</ul>

<hr />

<h2>DOM Example</h2>
<p>Look at the following XML file (<a target="_blank" href="books.xml">books.xml</a>):</p>

<table width="100%" border="1" class="ex" cellspacing="0" id="table17">
  <tr>
    <td>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;bookstore&gt;
&lt;book category=&quot;cooking&quot;&gt;
  &lt;title lang=&quot;en&quot;&gt;Everyday Italian&lt;/title&gt; 
  &lt;author&gt;Giada De Laurentiis&lt;/author&gt; 
  &lt;year&gt;2005&lt;/year&gt; 
  &lt;price&gt;30.00&lt;/price&gt; 
&lt;/book&gt;
&lt;book category=&quot;children&quot;&gt;
  &lt;title lang=&quot;en&quot;&gt;Harry Potter&lt;/title&gt; 
  &lt;author&gt;J K. Rowling&lt;/author&gt; 
  &lt;year&gt;2005&lt;/year&gt; 
  &lt;price&gt;29.99&lt;/price&gt; 
&lt;/book&gt;
&lt;book category=&quot;web&quot;&gt;
  &lt;title lang=&quot;en&quot;&gt;XQuery Kick Start&lt;/title&gt; 
  &lt;author&gt;James McGovern&lt;/author&gt; 
  &lt;author&gt;Per Bothner&lt;/author&gt; 
  &lt;author&gt;Kurt Cagle&lt;/author&gt; 
  &lt;author&gt;James Linn&lt;/author&gt; 
  &lt;author&gt;Vaidyanathan Nagarajan&lt;/author&gt; 
  &lt;year&gt;2003&lt;/year&gt; 
  &lt;price&gt;49.99&lt;/price&gt; 
&lt;/book&gt;
&lt;book category=&quot;web&quot; cover=&quot;paperback&quot;&gt;
  &lt;title lang=&quot;en&quot;&gt;Learning XML&lt;/title&gt; 
  &lt;author&gt;Erik T. Ray&lt;/author&gt; 
  &lt;year&gt;2003&lt;/year&gt; 
  &lt;price&gt;39.95&lt;/price&gt; 
&lt;/book&gt;
&lt;/bookstore&gt;</pre>
    </td>
  </tr>
</table>
<p>The root node in the XML above is named &lt;bookstore&gt;. All other nodes in the 
document 
are contained within &lt;bookstore&gt;.</p>
<p>The root node &lt;bookstore&gt; holds four &lt;book&gt; nodes.</p>
<p>The first &lt;book&gt; node holds four nodes: &lt;title&gt;, &lt;author&gt;, &lt;year&gt;, and 
&lt;price&gt;, which contains one text node each, &quot;Everyday Italian&quot;, &quot;Giada 
De Laurentiis&quot;, &quot;2005&quot;, and 
&quot;30.00&quot;.</p>
<hr />

<h2>Text is Always Stored in Text Nodes</h2>
<p>A common error in DOM processing is 
to expect an element node to contain text. </p>
<p>However, the text of an element node is stored in a text node.</p>
<p>In this example: <b>&lt;year&gt;2005&lt;/year&gt;</b>, the element node 
&lt;year&gt;, holds a 
text node with the value &quot;2005&quot;. </p>
<p>&quot;2005&quot; is <b>not</b> the value of the &lt;year&gt; element!</p>
<hr />

<a href="dom_intro.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="dom_nodetree.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -