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

📄 slide027.html

📁 《Big C++ 》Third Edition电子书和代码全集-Part1
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta content="blendTrans(Duration=2)" http-equiv="Page-Enter">
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<script language="JavaScript" src="./config.js"></script>
	<script language="JavaScript" src="./pageFormat.js"></script>
	<script><!-- // Set title on page
		title()
	//--></script>
</head>


<body>
<div onclick="document.location='slide028.html'">
<h2><font color="#009999">29.2 Parsing XML Documents (cont.)</font></h2>
<font size="+1">

<ul>
	<li>Use <tt>DOMNamedNodeMap</tt> to iterate over attributes</li>
	<li>Returned by <tt>getAttributes</tt>:
		<blockquote><tt>
			DOMNamedNodeMap* attributes = price_element-&gt;getAttributes();
		</tt></blockquote>
	</li>
	<li>Use <tt>item</tt> method to get a particular attribute:
		<blockquote><tt>
			int i = . . .;<br>
			<font color="#0000cc">
				// # between 0 and attributes-&gt;getLength() - 1</font><br>
			DOMNode* attribute_node = attributes-&gt;item(i);<br>
			XMLCh* attribute_name = attribute_node-&gt;getNodeName();<br>
			<font color="#0000cc">// For example, "currency"</font><br>
			XMLCh* attribute_value = attribute_node.getNodeValue();<br>
			<font color="#0000cc">// For example, "USD"</font>
		</tt></blockquote>
	</li>
</ul>

</font>

<hr>
<center><small>
	<a href='slide026.html'>prev</a>
	|<a href='slide001.html'>top</a>
	|<a href='slide028.html'>next</a>
</small></center>
</div>
</body>
</html>

⌨️ 快捷键说明

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