1. example. xml -- main data file
<? XML version = "1.0" encoding = "UTF-8"?>
<? XML: stylesheet type = "text/XSL" href = "example. XSL"?>
<Projects id = "1">
<Project title = "Level 1 title 1" Index = "1">
<Items istrunk = "false" Title = "Level 2 Title 1.1" id = "items_1">
<Result type = "2"> 1 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
<Remark> </remark>
</Items>
<Items istrunk = "false" Title = "Level 2 Title 1.2" id = "items_2">
<Result type = "2"> 3 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Items>
</Project>
<Project title = "Level 1 title 2" Index = "2">
<Items istrunk = "false" Title = "Level 2 Title 2.1" id = "items_3">
<Result type = "3"> 3 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Items>
<Items istrunk = "true" Title = "Level 2 Title 2.2">
<Item Title = "Level 3 title 2.2.1" id = "item_1">
<Result type = "1"> 2 </result>
<Officer> <! [CDATA [Garbled]> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
<Item Title = "Level 3 title 2.2.2" id = "item_2">
<Result type = "1"> 3 </result>
<Officer> <! [CDATA [<>]> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
</Items>
<Items istrunk = "true" Title = "Level 2 Title 2.3">
<Item Title = "Level 3 title 2.3.1" id = "item_3">
<Result type = "2"> 1 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
<Item Title = "Level 3 title 2.3.2" id = "item_4">
<Result type = "2"> 1 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
</Items>
</Project>
<Project title = "Level 1 title 3" Index = "3">
<Items istrunk = "false" Title = "Level 2 Title 3.1" id = "items_4">
<Result type = "4" Units = "RMB"> 25345 </result>
<Officer> <! [CDATA [sinoly]> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Items>
<Items istrunk = "false" Title = "Level 2 Title 3.2" id = "items_5">
<Result type = "4" Units = "RMB"> 9865764 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Items>
<Items istrunk = "false" Title = "Level 2 Title 3.3" id = "items_6">
<Result type = "2"> 0 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Items>
<Items istrunk = "true" Title = "Level 2 Title 3.4">
<Item Title = "Level 3 title 3.4.1" id = "item_5">
<Result type = "1"> 0 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
<Item Title = "Level 3 title 3.4.2" id = "item_6">
<Result type = "1"> 0 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
<Item Title = "Level 3 title 3.4.3" id = "item_7">
<Result type = "1"> 0 </result>
<Officer> <! [CDATA []> </officer>
<Classified> 1 </classified>
<Eligibility> 0 </Eligibility>
</Item>
</Items>
</Project>
</Projects>
2. example. XSL -- style file, which can easily retrieve XML data
<? XML version = "1.0" encoding = "gb2312"?>
<XSL: stylesheet version = "1.0" xmlns: XSL = "http://www.w3.org/1999/XSL/Transform">
<! -- Root template -->
<XSL: output method = "XML"/>
<XSL: template match = "/">
<XSL: Apply-templates select = "projects/Project"/>
<H6>
<Button type = "Submit" class = "btn1_mouseout" onmouseover = "this. classname = 'btn1 _ Mouseover '"onmouseout =" this. classname = 'btn1 _ mouseout' "Title =" "> next </button>
</H6>
</XSL: Template>
<! -- Level-1 question stem template -->
<XSL: template match = "items">
<Tr>
<TD colspan = "2" class = "tright">
<XSL: number value = "position ()" format = "1."/> <XSL: value-of select = "@ title"/>
</TD>
<XSL: Choose>
<XSL: When test = "@ istrunk [. = 'false']">
<XSL: Apply-templates select = "result"/>
<XSL: Apply-templates select = "officer"/>
</XSL: When>
<XSL: otherwise>
<TD colspan = "3" class = "tright" style = "color: Blue; font-weight: bolder">
Note the following points:
</TD>
<XSL: Apply-templates select = "item"/>
</XSL: otherwise>
</XSL: Choose>
</Tr>
</XSL: Template>
<! -- Level-2 Question stem template -->
<XSL: template match = "item">
<Tr>
<TD class = "tright" style = "padding-left: 20px" colspan = "2">
<H4> <XSL: number value = "position ()" format = "(). "/> <XSL: value-of select =" @ title "/> </H4>
</TD>
<XSL: Apply-templates select = "result"/>
<XSL: Apply-templates select = "officer"/>
</Tr>
</XSL: Template>
<! -- Select a box template -->
<XSL: template match = "result">
<XSL: Choose>
<XSL: When test = "@ type = '1'">
& Lt; TD width = "15%" & gt;
<XSL: element name = "select">
<XSL: attribute name = "name"> RE _ <XSL: value-of select = ".../@ ID"/> </XSL: attribute>
<! -- <Select name = "select"> -->
<XSL: Choose>
<XSL: When test = ". = '0'">
<Option value = "0" selected = "selected"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2"> basically match </option>
<Option value = "3"> non-conforming </option>
</XSL: When>
<XSL: When test = ". = '1'">
<Option value = "0"> select </option>
<Option value = "1" selected = "selected"> Yes </option>
<Option value = "2"> basically match </option>
<Option value = "3"> non-conforming </option>
</XSL: When>
<XSL: When test = ". = '2'">
<Option value = "0"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2" selected = "selected"> basically meets </option>
<Option value = "3"> non-conforming </option>
</XSL: When>
<XSL: When test = ". = '3'">
<Option value = "0"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2"> basically match </option>
<Option value = "3" selected = "selected"> not met </option>
</XSL: When>
</XSL: Choose>
<! -- </SELECT> -->
</XSL: Element>
</TD>
</XSL: When>
<XSL: When test = "@ type = '2'">
& Lt; TD width = "15%" & gt;
<XSL: element name = "select">
<XSL: attribute name = "name"> RE _ <XSL: value-of select = ".../@ ID"/> </XSL: attribute>
<XSL: Choose>
<XSL: When test = ". = '0'">
<Option value = "0" selected = "selected"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2"> NO </option>
</XSL: When>
<XSL: When test = ". = '1'">
<Option value = "0"> select </option>
<Option value = "1" selected = "selected"> Yes </option>
<Option value = "2"> NO </option>
</XSL: When>
<XSL: When test = ". = '3'">
<Option value = "0"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2" selected = "selected"> NO </option>
</XSL: When>
</XSL: Choose>
</XSL: Element>
</TD>
</XSL: When>
<XSL: When test = "@ type = '3'">
& Lt; TD width = "15%" & gt;
<XSL: element name = "select">
<XSL: attribute name = "name"> RE _ <XSL: value-of select = ".../@ ID"/> </XSL: attribute>
<XSL: Choose>
<XSL: When test = ". = '0'">
<Option value = "0" selected = "selected"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2"> none </option>
</XSL: When>
<XSL: When test = ". = '1'">
<Option value = "0"> select </option>
<Option value = "1" selected = "selected"> Yes </option>
<Option value = "2"> none </option>
</XSL: When>
<XSL: When test = ". = '3'">
<Option value = "0"> select </option>
<Option value = "1"> Yes </option>
<Option value = "2" selected = "selected"> none </option>
</XSL: When>
</XSL: Choose>
</XSL: Element>
</TD>
</XSL: When>
<XSL: otherwise>
& Lt; TD width = "15%" & gt;
<XSL: element name = "textarea">
<XSL: attribute name = "name"> RE _ <XSL: value-of select = ".. /@ ID "/> </XSL: attribute> <XSL: value-of select = ". "/>
</XSL: Element>
<XSL: value-of select = "@ units"/>
</TD>
</XSL: otherwise>
</XSL: Choose>
</XSL: Template>
<! -- Owner template -->
<XSL: template match = "officer">
<TD width = "9%" class = "tright"> owner </TD>
& Lt; TD width = "11%" & gt;
<XSL: element name = "textarea">
<XSL: attribute name = "name"> of _ <XSL: value-of select = ".../@ ID"/> </XSL: attribute>
<XSL: value-of select = "."/>
</XSL: Element>
</TD>
</XSL: Template>
</XSL: stylesheet>