xml学习(2)xml文档树结构图

XML 文档形成一种树结构

XML 文档必须包含根元素。该元素是所有其他元素的父元素。

XML 文档中的元素形成了一棵文档树。这棵树从根部开始,并扩展到树的最底端。

所有元素均可拥有子元素:


<root>
  <child>
    <subchild>.....</subchild>
  </child>
</root>






上图表示下面的 XML 中的一本书:

<bookstore>
<book category="COOKING">
  <title lang="en">Everyday Italian</title> 
  <author>Giada De Laurentiis</author> 
  <year>2005</year> 
  <price>30.00</price> 
</book>
<book category="CHILDREN">
  <title lang="en">Harry Potter</title> 
  <author>J K. Rowling</author> 
  <year>2005</year> 
  <price>29.99</price> 
</book>
<book category="WEB">
  <title lang="en">Learning XML</title> 
  <author>Erik T. Ray</author> 
  <year>2003</year> 
  <price>39.95</price> 
</book>
</bookstore>

例子中的根元素是 。文档中的所有 元素都被包含在 中。

元素有 4 个子元素:、< author>、<year>、<price>。</p><p> 以上就是xml学习(2)xml文档树结构图的内容,更多相关内容请关注硕下网(www.sxiaw.com)! </p><p><br></p> <button type="button" class="ask_text test-iframe-handle"> </button> </div> </article> <aside class="swnetnews"> <div class="lis"> <span><i>推荐内容</i></span> <ul> <li><a href="/doc/6532.html" title="怎么在vscode上打开html页面" target="_blank">怎么在vscode上打开html页面</a></li><li><a href="/doc/6658.html" title="phpmyadmin不能登录怎么办" target="_blank">phpmyadmin不能登录怎么办</a></li><li><a href="/doc/10464.html" title="在小米8se中定位的两种方法" target="_blank">在小米8se中定位的两种方法</a></li><li><a href="/doc/8784.html" title="在支付宝中找朋友帮还花呗的详细步骤" target="_blank">在支付宝中找朋友帮还花呗的详细步骤</a></li><li><a href="/doc/8233.html" title="教你轻松获取微博达人的具体方法" target="_blank">教你轻松获取微博达人的具体方法</a></li><li><a href="/doc/3678.html" title="golang怎么获取方法名" target="_blank">golang怎么获取方法名</a></li><li><a href="/doc/10281.html" title="Python轻量级Web框架:Bottle库!" target="_blank">Python轻量级Web框架:Bottle库!</a></li><li><a href="/doc/7715.html" title="MAC环境安装php、apache、MacPorts等环境配置" target="_blank">MAC环境安装php、apache、MacPorts等环境配置</a></li><li><a href="/doc/10769.html" title="分析redis原理及实现" target="_blank">分析redis原理及实现</a></li><li><a href="/doc/134.html" title="go语言的异常处理介绍" target="_blank">go语言的异常处理介绍</a></li> </ul> </div> </aside> </main> <script> // first, find all the div.code blocks document.querySelectorAll('pre').forEach(el => { // then highlight each hljs.highlightElement(el); hljs.lineNumbersBlock(el); }); </script> <link rel="stylesheet" type="text/css" href="/kan/css/basezb.css"> <script type="text/javascript" src="/kan/js/read.js"></script> <div style="display:none"> <div class="login-box" id="login-dialog"> <div class="login-top"><a rel="nofollow" id="login1" onclick="setTab('login',1,2);" >登录</a></div> <div class="login-form" id="nav-signin"> <!-- <div class="login-ico"><a rel="nofollow" class="qq" id="qqlogin" target="_blank" href="/user-center-qqlogin.html"> QQ </a></div> --> <div class="login-box-form" id="con_login_1"> <form id="loginform" action="/user-center-login.html" method="post" onsubmit="return false;"> <p class="int-text"> <input class="email" id="username" name="username" type="text" value="用户名或Email" onfocus="if(this.value=='用户名或Email'){this.value='';}" onblur="if(this.value==''){this.value='用户名或Email';};" ></p> <p class="int-text"> <input class="password1" type="password" id="password" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';" > </p> <p class="int-info"> <label class="ui-label"> </label> <label for="agreement" class="ui-label-checkbox"> <input type="checkbox" value="" name="cookietime" id="cookietime" checked="checked" value="2592000"> <input type="hidden" name="notforward" id="notforward" value="1"> <input type="hidden" name="dosubmit" id="dosubmit" value="1">记住我的登录 </label> <a rel="nofollow" class="aright" href="/user-center-forgetpwd.html" target="_blank"> 忘记密码? </a></p> <p class="int-btn"><a rel="nofollow" id="loginbt" class="loginbtn"><span>登录</span></a></p> </form> </div> </div> </div> </div> </div> <script type="text/javascript" src="/kan/js/foot_js.js"></script> <div id="footer"> <div class="w1200"> <p class="tips_text">本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。</p> <p class="tips_text">Copyright © 2004-2018 https://www.sxiaw.com. All Rights Reserved.<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?fa236be8ec7680639fbd4ee307fd0c69"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <a href="http://beian.miit.gov.cn/" target="_blank">津ICP备2023001793号-1</a></p> </div> </div> </body> </html>