操作引入xml檔案的書包(取值執行個體),xml書包

來源:互聯網
上載者:User

操作引入xml檔案的書包(取值執行個體),xml書包

取值執行個體:

引入xml檔案

<we>@{help/usr/users.xml:usr}</we>
迴圈取值(bags為xml檔案名稱)
 <for bags=help/usr/users.xml>       <tr>         ......       </tr>    </for>
取屬性值
        <td>@{help/usr/users.xml:name}</td><!--取屬性name,跟其他書包用法相同-->         <td>@{help/usr/users.xml:cnName}</td><!--取屬性cnName-->
取編號
         <td>@{help/usr/users.xml:HtokID}</td><!--取編號,固定關鍵字HtokID-->
取節點名
<td>@{help/usr/users.xml:@{help/usr/users.xml:HtokID}}</td><!--取節點名,固定用法,以編號為關鍵字-->
取文本
<td>@{help/usr/users.xml:user}</td><!--取文本,固定用法,以節點名為關鍵字-->
完整代碼
<table border=1> <tr><th>name</th><th>cnName</th><th>編號</th><th>節點名</th><th>文本</th></tr><chtml>    <we>@{help/usr/users.xml:usr}</we>    <for bags=help/usr/users.xml>       <tr>         <td>@{help/usr/users.xml:name}</td><!--取屬性name,跟其他書包用法相同-->         <td>@{help/usr/users.xml:cnName}</td><!--取屬性cnName-->         <td>@{help/usr/users.xml:HtokID}</td><!--取編號,固定關鍵字HtokID-->         <td>@{help/usr/users.xml:@{help/usr/users.xml:HtokID}}</td><!--取節點名,固定用法,以編號為關鍵字-->         <td>@{help/usr/users.xml:user}</td><!--取文本,固定用法,以節點名為關鍵字-->       </tr>    </for></chtml></table>
操作的xml檔案(help/usr/users.xml)在 輕開平台的help/usr目錄下,內容為
<?xml version="1.0" encoding="GB2312"?><users><user cnName="2341243" name="erwer2334" pass="12">12341324 1234</user><user cnName="哈佩" name="Happy" pass="1">123 備忘就是一些說明! </user><user cnName="34234" name="324" pass="3">'''''</user><user cnName="qwer" name="124" pass="qwer"><script>alert("test");<script></user><user cnName="rtr" name="trr" pass="rt">trtr</user></users>

效果

(例子檔案:_samples/xml_get.html)在輕開平台的_samples目錄下

另外還有取父節點 @{id:parentID}、取層數 @{id:weTier}和取子節點數 @{id:weSubs}三個固定關鍵字

輕鬆互連網開發平台(Easy Do IT)資源下載

平台及最新開發手冊免費下載:http://download.csdn.net/detail/tx18/8464425

開發執行個體:輕開B2C電子商務網站,免費下載:http://download.csdn.net/detail/tx18/8318585

輕開平台會不定期升級為大家提供更多強大而Easy的功能,請留意下載最新的版本


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.