﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-大道致远</title><link>http://www.blogjava.net/wyg405/</link><description>前途漫漫</description><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 09:39:41 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 09:39:41 GMT</pubDate><ttl>60</ttl><item><title>Hashtable 的遍历</title><link>http://www.blogjava.net/wyg405/archive/2007/01/31/96978.html</link><dc:creator>wyg405</dc:creator><author>wyg405</author><pubDate>Wed, 31 Jan 2007 07:10:00 GMT</pubDate><guid>http://www.blogjava.net/wyg405/archive/2007/01/31/96978.html</guid><wfw:comment>http://www.blogjava.net/wyg405/comments/96978.html</wfw:comment><comments>http://www.blogjava.net/wyg405/archive/2007/01/31/96978.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wyg405/comments/commentRss/96978.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wyg405/services/trackbacks/96978.html</trackback:ping><description><![CDATA[如果不知道Hashtable中的KEY，可以用下面的方同取得KEY！  <br />public static void printall(Hashtable ht){<br />    Enumeration en = ht.keys();<br />    while(en.hasMoreElements()){<br />      Object key_num = en.nextElement();<br />      System.out.print("DEBUG: " + key_num);<br />      System.out.print(" = ");<br />      System.out.println(ht.get(key_num));<br />    }<br />  } <img src ="http://www.blogjava.net/wyg405/aggbug/96978.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wyg405/" target="_blank">wyg405</a> 2007-01-31 15:10 <a href="http://www.blogjava.net/wyg405/archive/2007/01/31/96978.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java NIO 传对象</title><link>http://www.blogjava.net/wyg405/archive/2007/01/31/dream.html</link><dc:creator>wyg405</dc:creator><author>wyg405</author><pubDate>Wed, 31 Jan 2007 07:08:00 GMT</pubDate><guid>http://www.blogjava.net/wyg405/archive/2007/01/31/dream.html</guid><wfw:comment>http://www.blogjava.net/wyg405/comments/96977.html</wfw:comment><comments>http://www.blogjava.net/wyg405/archive/2007/01/31/dream.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wyg405/comments/commentRss/96977.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wyg405/services/trackbacks/96977.html</trackback:ping><description><![CDATA[
		<p>//Client 端：<br />  Student pgt=new Student();<br />  pgt.setName("name");<br />  pgt.setAge("age");<br />  ByteArrayOutputStream baos = new ByteArrayOutputStream();<br />  ObjectOutputStream oos = new ObjectOutputStream(baos);<br />  oos.writeObject(pgt);<br />  oos.close();<br />  byte[] bs = baos.toByteArray();<br />  ByteBuffer buffer = ByteBuffer.wrap(bs, 0, bs.length);<br />  <br />    while (buffer.hasRemaining() &amp; client.write(buffer) != -1) <br />    {<br />       waitFor(1000);<br />    }<br />    buffer.flip();</p>
		<p>//Server 端：<br />       int reads = sc_key.read(byteBuffer);<br />       byteBuffer.flip();<br />       byte[] tmp_buffer = byteBuffer.array();<br />       ByteArrayInputStream byteIn = new ByteArrayInputStream(tmp_buffer);<br />       ObjectInputStream objIn = new ObjectInputStream(byteIn);<br />       pgt = (Student) objIn.readObject();<br />       objIn.close();</p>
<img src ="http://www.blogjava.net/wyg405/aggbug/96977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wyg405/" target="_blank">wyg405</a> 2007-01-31 15:08 <a href="http://www.blogjava.net/wyg405/archive/2007/01/31/dream.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ByteBuffer 转化为 String</title><link>http://www.blogjava.net/wyg405/archive/2007/01/31/wyg.html</link><dc:creator>wyg405</dc:creator><author>wyg405</author><pubDate>Wed, 31 Jan 2007 07:02:00 GMT</pubDate><guid>http://www.blogjava.net/wyg405/archive/2007/01/31/wyg.html</guid><wfw:comment>http://www.blogjava.net/wyg405/comments/96971.html</wfw:comment><comments>http://www.blogjava.net/wyg405/archive/2007/01/31/wyg.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wyg405/comments/commentRss/96971.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wyg405/services/trackbacks/96971.html</trackback:ping><description><![CDATA[
		<p> </p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #008080"> 1</span>
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #0000ff">public</span>
				<span style="COLOR: #000000"> String decode(ByteBuffer buffer)<br /></span>
				<span style="COLOR: #008080"> 2</span>
				<span style="COLOR: #000000">
						<img id="Codehighlighter1_41_506_Open_Image" onclick="this.style.display='none'; Codehighlighter1_41_506_Open_Text.style.display='none'; Codehighlighter1_41_506_Closed_Image.style.display='inline'; Codehighlighter1_41_506_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
				</span>
				<span id="Codehighlighter1_41_506_Open_Text">
						<span style="COLOR: #000000">{<br /></span>
						<span style="COLOR: #008080"> 3</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">buffer=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000"> buffer);<br /></span>
						<span style="COLOR: #008080"> 4</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        Charset charset </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">null</span>
						<span style="COLOR: #000000">;<br /></span>
						<span style="COLOR: #008080"> 5</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        CharsetDecoder decoder </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">null</span>
						<span style="COLOR: #000000">;<br /></span>
						<span style="COLOR: #008080"> 6</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        CharBuffer charBuffer </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">null</span>
						<span style="COLOR: #000000">;<br /></span>
						<span style="COLOR: #008080"> 7</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
						<span style="COLOR: #0000ff">try</span>
						<span style="COLOR: #000000">
								<br />
						</span>
						<span style="COLOR: #008080"> 8</span>
						<span style="COLOR: #000000">
								<img id="Codehighlighter1_184_433_Open_Image" onclick="this.style.display='none'; Codehighlighter1_184_433_Open_Text.style.display='none'; Codehighlighter1_184_433_Closed_Image.style.display='inline'; Codehighlighter1_184_433_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />    </span>
						<span id="Codehighlighter1_184_433_Open_Text">
								<span style="COLOR: #000000">{<br /></span>
								<span style="COLOR: #008080"> 9</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            charset </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> Charset.forName(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">gb2312</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);<br /></span>
								<span style="COLOR: #008080">10</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            decoder </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> charset.newDecoder();<br /></span>
								<span style="COLOR: #008080">11</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            charBuffer </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> decoder.decode(buffer);<br /></span>
								<span style="COLOR: #008080">12</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            System.out.println(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">charBuffer=</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #000000">+</span>
								<span style="COLOR: #000000"> charBuffer);<br /></span>
								<span style="COLOR: #008080">13</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            System.out.println(charBuffer.toString());<br /></span>
								<span style="COLOR: #008080">14</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
								<span style="COLOR: #0000ff">return</span>
								<span style="COLOR: #000000"> charBuffer.toString();<br /></span>
								<span style="COLOR: #008080">15</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
						</span>
						<span style="COLOR: #008080">16</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        </span>
						<span style="COLOR: #0000ff">catch</span>
						<span style="COLOR: #000000"> (Exception ex)<br /></span>
						<span style="COLOR: #008080">17</span>
						<span style="COLOR: #000000">
								<img id="Codehighlighter1_460_503_Open_Image" onclick="this.style.display='none'; Codehighlighter1_460_503_Open_Text.style.display='none'; Codehighlighter1_460_503_Closed_Image.style.display='inline'; Codehighlighter1_460_503_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />    </span>
						<span id="Codehighlighter1_460_503_Open_Text">
								<span style="COLOR: #000000">{<br /></span>
								<span style="COLOR: #008080">18</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            ex.printStackTrace();<br /></span>
								<span style="COLOR: #008080">19</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            </span>
								<span style="COLOR: #0000ff">return</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #000000">""</span>
								<span style="COLOR: #000000">;<br /></span>
								<span style="COLOR: #008080">20</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
						</span>
						<span style="COLOR: #008080">21</span>
						<span style="COLOR: #000000">
								<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> }</span>
				</span>
		</div>
<img src ="http://www.blogjava.net/wyg405/aggbug/96971.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wyg405/" target="_blank">wyg405</a> 2007-01-31 15:02 <a href="http://www.blogjava.net/wyg405/archive/2007/01/31/wyg.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DOM4J解析XML</title><link>http://www.blogjava.net/wyg405/archive/2006/11/12/wyg405.html</link><dc:creator>wyg405</dc:creator><author>wyg405</author><pubDate>Sun, 12 Nov 2006 08:24:00 GMT</pubDate><guid>http://www.blogjava.net/wyg405/archive/2006/11/12/wyg405.html</guid><wfw:comment>http://www.blogjava.net/wyg405/comments/80711.html</wfw:comment><comments>http://www.blogjava.net/wyg405/archive/2006/11/12/wyg405.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wyg405/comments/commentRss/80711.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wyg405/services/trackbacks/80711.html</trackback:ping><description><![CDATA[
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">Document doc </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />doc </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> DocumentHelper.createDocument();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">添加根结点。</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">Element root </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> doc.addElement(</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">root</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">为根结点添加子结点。</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">Element child </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> root.addElement(</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">child</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">为节点添加属性</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">child.addAttribute(</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">childattribute</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">attribute</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">为节点添加Text</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">child.setText(</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">Text</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">遍历所有结点的方法</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Element element </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> doc.getRootElement();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #0000ff">public</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">void</span>
				<span style="COLOR: #000000"> xmlIterator(Element element)<br /><img id="Codehighlighter1_354_607_Open_Image" onclick="this.style.display='none'; Codehighlighter1_354_607_Open_Text.style.display='none'; Codehighlighter1_354_607_Closed_Image.style.display='inline'; Codehighlighter1_354_607_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /></span>
				<span id="Codehighlighter1_354_607_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
				</span>
				<span id="Codehighlighter1_354_607_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />       </span>
						<span style="COLOR: #0000ff">for</span>
						<span style="COLOR: #000000"> (</span>
						<span style="COLOR: #0000ff">int</span>
						<span style="COLOR: #000000"> i </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">0</span>
						<span style="COLOR: #000000">, size </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> element.nodeCount(); i </span>
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000"> size; i</span>
						<span style="COLOR: #000000">++</span>
						<span style="COLOR: #000000">)    <br /><img id="Codehighlighter1_434_603_Open_Image" onclick="this.style.display='none'; Codehighlighter1_434_603_Open_Text.style.display='none'; Codehighlighter1_434_603_Closed_Image.style.display='inline'; Codehighlighter1_434_603_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />        </span>
						<span id="Codehighlighter1_434_603_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						</span>
						<span id="Codehighlighter1_434_603_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />           Node node </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> element.node(i);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />           </span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000"> (node </span>
								<span style="COLOR: #0000ff">instanceof</span>
								<span style="COLOR: #000000"> Element) <br /><img id="Codehighlighter1_529_589_Open_Image" onclick="this.style.display='none'; Codehighlighter1_529_589_Open_Text.style.display='none'; Codehighlighter1_529_589_Closed_Image.style.display='inline'; Codehighlighter1_529_589_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />            </span>
								<span id="Codehighlighter1_529_589_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								</span>
								<span id="Codehighlighter1_529_589_Open_Text">
										<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                xmlIterator((Element) node);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />             }</span>
								</span>
								<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />          }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />  }</span>
				</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">如果想不遍历而得到某一节点，那么就要为每一个节点添加一个ID属性<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">例如：Element.addAttribute("ID",id);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">然后用以下方法即可。</span>
				<span style="COLOR: #008000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #000000">Element findElement </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> doc.elementByID(id);</span>
		</div>
<img src ="http://www.blogjava.net/wyg405/aggbug/80711.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wyg405/" target="_blank">wyg405</a> 2006-11-12 16:24 <a href="http://www.blogjava.net/wyg405/archive/2006/11/12/wyg405.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>