XML文件
- 更新时间2025-08-27
- 阅读时长2分钟
可扩展标记语言(XML)是一种用标记描述数据的格式化标准。与HTML标记不同,XML标记不会告诉浏览器如何按格式处理数据,而是使浏览器能识别数据。
例如,假定书商要在网上出售图书。库中的图书按以下标准进行分类:
- 书的类型(小说或非小说)
- 标题
- 作者
- 出版商(publisher)
- 价格
- 体裁(genre)
- 摘要(synopsis)
- 页数(pages)
现可为每本书创建一个XML文件。书名为Touring Germany's Great Cathedrals的XML文件大致内容如下:
<nonfiction>
<Title>Touring Germany's Great Cathedrals</Title>
<Author>Tony Walters</Author>
<Publisher>Douglas Drive Publishing</Publisher>
<PriceUS>$29.99</PriceUS>
<Genre>Travel</Genre>
<Genre>Architecture</Genre>
<Genre>History</Genre>
<Synopsis>This book fully illustrates twelve of Germany's most inspiring cathedrals with full-color photographs, scaled cross-sections, and time lines of their construction.</Synopsis>
<Pages>224</Pages>
</nonfiction>
同样,也可根据名称、值和类型对LabVIEW数据进行分类。可使用以下XML表示一个用户名称的字符串控件:
<String>
<Name>User Name</Name>
<Value>Reggie Harmon</Value>
</String>