Академический Документы
Профессиональный Документы
Культура Документы
<TD>
<TABLE DATASRC=“#xmldso” DATAFLD=“author”>
<TR><TD><SPAN DATAFLD=“$Text”></SPAN></TD></TR>
</TABLE>
</TD>
Accessing XML Attributes
• XML attributes are treated as child
elements
<book genre=“Autobiography”>
<title>The Autobiography of Benjamin Franklin</title>
<author>Benjamin Franklin</author>
<price>8.99</price>
</book>
<book genre=“Literature”>
<title>The Confidence Man</title>
<author>Herman Melville</author>
<price>11.99</price>
</book>
<TD><SPAN DATAFLD=“genre”></SPAN></TD>
<TD><SPAN DATAFLD =“title”></SPAN></TD>
Navigating the DSO Recordset
• You can navigate through your DSO
Recordset by adding script to call the
ADO move methods:
– Move, MoveFirst, MoveLast, MoveNext,
MovePrevious
• Example
xmldso.recordset.MoveNext
Adding Navigation
• Add a field to display the data
• Add a button to invoke the desired
move method.
<XML ID=“xmldso” SRC=“books.xml”></XML>
<FORM>
<!-- create field to display the data -->
Title:
<INPUT TYPE=‘text’ DATASRC=“#xmldso”
DATAFLD=“title”>
<!-- add a button to step through the XML data -->
<INPUT TYPE=“button” ID=“btnNext” Value=“Next”>
</FORM>
Adding Navigation, cont.
• Set an onclick event procedure for the
button that calls the move command.
<HEAD>
<script language=“VBScript”>
Sub btnNext_onclick()
xmldso.recordset.MoveNext
End Sub
</script>
</HEAD>
Sources