Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 244 | chris | 1 | <!-- below is an example of an instruction. The XMLParser class can handle instruction syntax, |
| 2 | but you'll notice that in the XMLDemo we don't actually use the value, we just ignore it. --> |
||
| 3 | <?xml version="1.0"?> |
||
| 4 | |||
| 5 | <!-- Sections contain nested items --> |
||
| 6 | <Section1> |
||
| 7 | |||
| 8 | <!-- This item, "Item1", contains just 1 attribute, "text", and nothing more --> |
||
| 9 | <Item1 text="Some text for Section1/Item1"/> |
||
| 10 | |||
| 11 | <!-- This item, "BoolParam", contains an attribute, "text", as well as an element value, |
||
| 12 | which is the string "true" --> |
||
| 13 | <BoolParam text="Some text for Section1/BoolParam">true</BoolParam> |
||
| 14 | |||
| 15 | <!-- end of the section --> |
||
| 16 | </Section1> |
||
| 17 | |||
| 18 | <!-- This section contains an attribute in its line --> |
||
| 19 | <Section2 s2attrib="Section2 attrib text"> |
||
| 20 | <IntParam text="Some text for Section2/IntParam">1234</IntParam> |
||
| 21 | |||
| 22 | <!-- This just shows that you can split things up across lines. This is functionally equivalent to: |
||
| 23 | <MultiAttrib attrib1="attrib1" attrib2="2" attrib3="woo! attrib3!"/> --> |
||
| 24 | |||
| 25 | <MultiAttrib |
||
| 26 | attrib1="attrib1" |
||
| 27 | attrib2="2" |
||
| 28 | attrib3="woo! attrib3!" |
||
| 29 | /> |
||
| 30 | |||
| 31 | <!-- The XMLParser class handles nested sections as well --> |
||
| 32 | <Subsection> |
||
| 33 | <!-- and of course, you can put more items in here, like any other section --> |
||
| 34 | <Item2>Text for Section2/Subsection/Item2</Item2> |
||
| 35 | </Subsection> |
||
| 36 | |||
| 37 | </Section2> |
||
| 38 |