The bag (value example) for importing xml files and the xml bag
Value example:
Introduce xml files
<we>@{help/usr/users.xml:usr}</we>
Loop value (bags is the xml file name)
<for bags=help/usr/users.xml> <tr> ...... </tr> </for>
Get Attribute Value
<Td >@{ help/usr/users. xml: name} </td> <! -- Get the attribute name, which is used in the same way as other school bags --> <td >@{ help/usr/users. xml: cnName} </td> <! -- Retrieve the cnName attribute -->
Number
<Td >@{ help/usr/users. xml: HtokID} </td> <! -- Take the number, fixed keyword HtokID -->
Node name
<Td >@{ help/usr/users. xml: @ {help/usr/users. xml: HtokID }}</td> <! -- Take the node name, fixed usage, with number as the Keyword -->
Retrieve text
<Td >@{ help/usr/users. xml: user} </td> <! -- Take the text, fix the usage, and use the node name as the Keyword -->
Complete code
<Table border = 1> <tr> <th> name </th> <th> cnName </th> <th> NO. </th> <th> node name </ th> <th> text </th> </tr> <chtml> <we >@{ help/usr/users. xml: usr }</we> <for bags = help/usr/users. xml> <tr> <td >@{ help/usr/users. xml: name }</td> <! -- Get the attribute name, which is used in the same way as other school bags --> <td >@{ help/usr/users. xml: cnName} </td> <! -- Retrieve the cnName --> <td >@{ help/usr/users. xml: HtokID} </td> <! -- Take the number, fixed keyword HtokID --> <td >@{ help/usr/users. xml: @ {help/usr/users. xml: HtokID }}</td> <! -- Get the node name, fixed usage, with the number as the Keyword --> <td >@{ help/usr/users. xml: user} </td> <! -- Take the text for fixed usage, and use the node name as the Keyword --> </tr> </for> </chtml> </table>
The xml file for the operation (help/usr/users. xml) in
Light PlatformIn the help/usr directory, the content is
<? Xml version = "1.0" encoding = "GB2312"?> <Users> <user cnName = "2341243" name = "erwer2334" pass = "12"> 12341324 1234 </user> <user cnName = "hapei" name = "Happy" pass = "1"> 123 remarks are some notes! </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>
Effect
(Example file: _ samples/xml_get.html) inLight PlatformUnder the _ samples Directory
In addition, the parent node is also used.
@{Id: parentID}, number of layers
@{Id: weTier} and number of Child Nodes
@Three Fixed keywords: {id: weSubs}
Download Easy Do IT resources
Platform and the latest development manual free download: http://download.csdn.net/detail/tx18/8464425
Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585
The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version