-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce18ae9
commit 2a5d2ba
Showing
1 changed file
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
> 课本 P266 上机题目 | ||
|
||
|
||
## 第 1 题 | ||
|
||
对于下列 XML 文档 | ||
|
||
```xml | ||
<?xml version="1.0"?> | ||
<purchaseOrder> | ||
<shipTo country="US"> | ||
<name>Alice Smith</name> | ||
<street>123 Maple Street</street> | ||
<city>Mill Valley</city> | ||
<state>CA</state> | ||
<zip>90952</zip> | ||
</shipTo> | ||
<billTo country="US"> | ||
<name>Robert Smith</name> | ||
<street>8 Oak Avenue</street> | ||
<city>Old Town</city> | ||
<state>PA</state> | ||
<zip>95819</zip> | ||
</billTo> | ||
<comment>Hurry, my lawn is going wild!</comment> | ||
<items> | ||
<item partNum="872-AA"> | ||
<productName>Lawnmower</productName> | ||
<quantity>1</quantity> | ||
<USPrice>148.95</USPrice> | ||
<comment>Confirm this is electric</comment> | ||
</item> | ||
</items> | ||
</purchaseOrder> | ||
``` | ||
|
||
要求: | ||
|
||
1. 在 .NET 集成开发环境中,使用流模式读取此文档,并根据其节点类型在控制台中输出节点内容,以及输出此 XML 文档中每种节点类型的数目。 | ||
2. 使用 DataSet 对象读取此 XML 文档,并将此文档对应的模式文件写进磁盘进行保存。 | ||
|
||
|
||
|
||
## 第 2 题 | ||
|
||
对于下列 XML 文档 | ||
|
||
```xml | ||
<?xml version="1.0"?> | ||
<bookstore> | ||
<book genre="novel"> | ||
<title>The Confidence Man</title> | ||
<author> | ||
<first-name>Herman</first-name | ||
<last-name>Melville</last-name> | ||
</author> | ||
<price>11.99</price> | ||
</book> | ||
<book genre="novel"> | ||
<title>Pride And Prejudice</title> | ||
<author> | ||
<first-name>Jane</first-name> | ||
<last-name>Austen</last-name> | ||
</author> | ||
<price>24.95</price> | ||
</book> | ||
<book genre="novel"> | ||
<title>The Handmaid's Tale</title> | ||
<author> | ||
<first-name>Margaret</first-name> | ||
<last-name>Atwood</last-name> | ||
</author> | ||
<price>29.95</price> | ||
</book> | ||
<book genre="novel"> | ||
<title>Emma</title> | ||
<author> | ||
<first-name>Jane</first-name> | ||
<last-name>Austen</last-name> | ||
</author> | ||
<price>19.95</price> | ||
</book> | ||
<book genre="novel"> | ||
<title>Sense And Sensibility</title> | ||
<author> | ||
<first-name>Jane</first-name> | ||
<last-name>Austen</last-name> | ||
</author> | ||
<price>19.95</price> | ||
</book> | ||
</bookstore> | ||
``` | ||
|
||
在 .NET 集成开发环境中创建一个名为 NavigateXmlDoc 的 Windows 应用程序,在此应用程序中使用 DOM 读取此文档,并对文档中的节点进行遍历。 | ||
|
||
要求: | ||
|
||
1. 设计窗体的外观如图 10-18 所示。 | ||
2. |