请选择 进入手机版 | 继续访问电脑版
楼主: Nicolle
1208 12

XML: Visual QuickStart Guide, Second Edition [推广有奖]

巨擘

0%

还不是VIP/贵宾

-

TA的文库  其他...

Python(Must-Read Books)

SAS Programming

Must-Read Books

威望
16
论坛币
12402323 个
通用积分
1620.8615
学术水平
3305 点
热心指数
3329 点
信用等级
3095 点
经验
477211 点
帖子
23879
精华
91
在线时间
9878 小时
注册时间
2005-4-23
最后登录
2022-3-6

Nicolle 学生认证  发表于 2015-10-17 10:04:36 |显示全部楼层 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

本帖被以下文库推荐

hjtoh 发表于 2015-10-17 10:47:54 来自手机 |显示全部楼层 |坛友微信交流群
Nicolle 发表于 2015-10-17 10:04
  • XML: Visual QuickStart Guide, Second Edition
  • By: Kevin Howard Goldberg
  • Publisher: P ...
  • 收藏了再说
    已有 1 人评分论坛币 收起 理由
    Nicolle + 20 沙发-地板

    总评分: 论坛币 + 20   查看全部评分

    使用道具

    牛尾巴 发表于 2015-10-17 18:07:43 |显示全部楼层 |坛友微信交流群

    本帖隐藏的内容

    XML_ Visual QuickStart Guide.pdf (4.34 MB)


    已有 1 人评分经验 论坛币 收起 理由
    Nicolle + 100 + 100 精彩帖子

    总评分: 经验 + 100  论坛币 + 100   查看全部评分

    使用道具

    ReneeBK 发表于 2015-10-24 19:04:21 |显示全部楼层 |坛友微信交流群
    1. Tools for Writing XML

    2. XML, like HTML, can be written using any text editor or word processor. There are also many XML editors that have been created since the first edition of this book. These editors have various capabilities, such as validating your XML as you type (see Appendix A).
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:05:08 |显示全部楼层 |坛友微信交流群
    1. Figure 1.1. An XML document describing one of the Seven Wonders of the World: the Colossus of Rhodes. The document contains the name of the wonder, as well as its location and its height in feet.

    2. x m l
    3. <?xml version="1.0"?>
    4.                                                                                                 <wonder>
    5.                                                                                                 <name>Colossus of Rhodes</name>
    6.                                                                                                 <location>Rhodes, Greece</location>
    7.                                                                                                 <height units="feet">107</height>
    8.                                                                                                 </wonder>
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:06:09 |显示全部楼层 |坛友微信交流群
    1. Figure 1.2. Here I am extending the XML document in Figure 1.1 above to support multiple <wonder> elements. This is done by creating a new root element <ancient_wonders> which will contain as many <wonder> elements as desired. Now, the XML document contains information about the Colossus of Rhodes along with the Great Pyramid of Giza, which is located in Giza, Egypt, and is 455 feet tall.

    2. x m l
    3. <?xml version="1.0"?>
    4.                                                                                                 <ancient_wonders>
    5.                                                                                                 <wonder>
    6.                                                                                                 <name>Colossus of Rhodes</name>
    7.                                                                                                 <location>Rhodes, Greece</location>
    8.                                                                                                 <height units="feet">107</height>
    9.                                                                                                 </wonder>
    10.                                                                                                 <wonder>
    11.                                                                                                 <name>Great Pyramid of Giza</name>
    12.                                                                                                 <location>Giza, Egypt</location>
    13.                                                                                                 <height units="feet">455</height>
    14.                                                                                                 </wonder>
    15.                                                                                                 </ancient_wonders>
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:07:00 |显示全部楼层 |坛友微信交流群
    1. Figure 1.3. In a well-formed XML document, there must be one element (wonder) that contains all other elements. This is called the root element. The first line of an XML document is an exception because it’s a processing instruction and not part of the XML data.

    2. x m l
    3. <?xml version="1.0"?>
    4.                                                                                                         <wonder>
    5.                                                                                                         <name>Colossus of Rhodes</name>
    6.                                                                                                         </wonder>
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:08:04 |显示全部楼层 |坛友微信交流群
    1. Figure 1.4. Every element must be enclosed by matching tags such as the name element. Empty elements like main_image can have an all-in-one opening and closing tag with a final slash. Notice that all elements are properly nested; that is, none are overlapping.

    2. x m l
    3. <?xml version="1.0"?>
    4.                                                                                                         <wonder>
    5.                                                                                                         <name>Colossus of Rhodes</name>
    6.                                                                                                         <main_image file="colossus.jpg"/>
    7.                                                                                                         </wonder>
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:08:59 |显示全部楼层 |坛友微信交流群
    1. Figure 1.6. The quotation marks are required. They can be single or double, as long as they match each other. Note that the value of the file attribute doesn’t necessarily refer to an image; it could just as easily say “The picture from last summer’s vacation”.

    2. x m l
    3. <main_image file="colossus.jpg"/>
    复制代码

    使用道具

    ReneeBK 发表于 2015-10-24 19:12:20 |显示全部楼层 |坛友微信交流群

    1. White Space

    2. You can add extra white space, including line breaks, around the elements in your XML code to make it easier to edit and view (Figure 1.9). While extra white space is visible in the file and when passed to other applications, it is ignored by the XML processor, just as it is with HTML in a browser.

    3. Figure 1.9. The wonder element shown here contains three other elements (name, location, and height), but it has no text of its own. The name, location and height elements contain text, but no other elements. The height element is the only element that has an attribute. Notice also that I’ve added extra white space (green, in this illustration), to make the code easier to read.
    复制代码


    使用道具

    您需要登录后才可以回帖 登录 | 我要注册

    本版微信群
    加好友,备注jltj
    拉您入交流群

    京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

    GMT+8, 2024-4-18 09:06