XML%20eXtensible%20Markup%20Language - PowerPoint PPT Presentation

About This Presentation
Title:

XML%20eXtensible%20Markup%20Language

Description:

title Harry Potter and the Secret Chamber /title city New York /city year 2005 /year ... book[last()] ; book[position() 3] ??????? ?? ???????? ????????? ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 15
Provided by: NSFG4
Category:

less

Transcript and Presenter's Notes

Title: XML%20eXtensible%20Markup%20Language


1
XML eXtensible Markup Language
  1. ??????????? ???? ?????????? (DTD)
  2. ???? ????????? ?????? XML-????????? (XPath)

2
??????????? ???? (DTD)
  • DTD Document Type Definition
  • ?????? ????????? ????????? ??? ?????????? ????
    XML-??????????(?. ?. ?????? ???? ????????? ????)
  • ??? ????? ?????????? ????????
  • ??? ??? ????? ???? ? ????? ????????????
  • ????? ? ??????? ???????? ????? ???? ????????

3
????????? XML-????????
  • www.firstobject.com
  • (?????? ?????? 2.2.5, exe ? ?????? zip)

4
??????? XML-????????
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • lt!DOCTYPE booklist SYSTEM "books-1.dtd"gt
  • ltbooklistgt
  • ltbookgt
  • ltauthorgt?.?. ????????lt/authorgt
  • lttitlegt????????????? ?????????lt/titlegt
  • ltcitygt??????lt/citygt
  • ltyeargt2008lt/yeargt
  • lt/bookgt
  • ltbookgt
  • ltauthorgtJ.K. Rowlinglt/authorgt
  • lttitlegtHarry Potter and the Secret
    Chamberlt/titlegt
  • ltcitygtNew Yorklt/citygt
  • ltyeargt2005lt/yeargt
  • lt/bookgt
  • lt/booklistgt

5
??????????? ???? (DTD)
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • lt!ELEMENT booklist (book)gt
  • lt!ELEMENT book (author, title, city, year)gt
  • lt!ELEMENT author (PCDATA)gt
  • lt!ELEMENT title (PCDATA)gt
  • lt!ELEMENT city (PCDATA)gt
  • lt!ELEMENT year (PCDATA)gt

6
??????????? ???? (DTD)
  • ?????????? ?????????
  • lt!ELEMENT book (author, title, city, year)gt
  • author, title ??????????????????
  • authortitle ????? (??? ???)
  • EMPTY ?????? ???????
  • ANY ????? ?????????? ?????????? ?????
  • PCDATA Parsed Character Data

?????? ???????? ?????????
7
??????????? ???? (DTD)
  • ?????????? ?????????? ????????
  • lt!ELEMENT booklist (book)gt
  • book 1, ????????????
  • book? 1, ?????????????? (0 ??? 1)
  • book 1 ??? ?????? (??????? ??????)
  • book 0 ??? ?????? (??????? ??????)
  • ??????? ? book ?????????????? ??????? publisher?
    (????????????)

8
??????????? ???? (DTD)
  • ????????? ????????
  • ? ????????
  • ltbook lang"rus" bookid"AAZ01"gt
  • ltauthorgt?.?. ????????lt/authorgt
  • lt/bookgt
  • ? DTD
  • lt!ATTLIST book
  • lang CDATA IMPLIED
  • bookid ID REQUIREDgt

??? ????????
9
??????????? ???? (DTD)
  • ???? ?????????
  • lt!ATTLIST book
  • lang CDATA IMPLIED
  • bookid ID REQUIRED
  • genre (fictionnonfiction) IMPLIEDgt
  • CDATA ??????? ????? (Character data)
  • ID ????????????? (???????? ?? ?????
    ???????????)
  • IDREF ?????? ?? ????????????? ??????? ????????
  • (....) ???? ?? ????????????? ????????

10
??????????? ???? (DTD)
  • ???????? ????????? ?? ?????????
  • lt!ATTLIST book
  • lang CDATA "eng"
  • bookid ID REQUIRED
  • genre (fictionnonfiction) IMPLIEDgt
  • ???? ???????? ????????, ????
  • IMPLIED ??????? ????????????
  • REQUIRED ??????? ????????????
  • FIXED ???????? ???????? ?????????

11
XPath ????????? ?????? ?????????
  • ???????? ???????
  • ????? ????? (nodeset)????????? ?? XPath (????)
    ????????? ????? ????? ? ?????????
  • ????????
  • ????????
  • ?????? ????????? (???????? ???????)
  • ?????????? / ????????????? ????
  • ????????-????
  • ???????? (???? ?????? ??????)
  • ??????-???????

12
XPath ????????? ?????? ?????????
  • ??????? ?????????
  • ???? ?? ????? (??????????) ?????????? ? /
  • ???????? ???? ????? ????? / ??? ?? ?????? (??
    ????????? ?? ????? ? ???????)
  • ? ????????? ?????? ??? ????, ?????????? ???
    ????????? ????
  • /booklist /booklist/book/author
  • ???? ??? / (?????????????) ????????? ?? ?? ?????,
    ? ?? ??????? ???????
  • book/author
  • // ????? ?????????? ?????
  • //book //author /booklist//author
  • _at_ ???????
  • //book/_at_lang

13
XPath ????????? ?????? ?????????
  • ??????? ?????????
  • . (?????) ??????? ????
  • .. (??? ?????) ???????????? ????
  • ../title (???? ?? book/author ? book/title)
  • ????? ???? ??? ???????? ?????
  • /booklist/ ??? ????
  • /booklist// ??? ?????
  • //book/_at_ ??? ????????

14
XPath ????????? ?????? ?????????
  • ????????? ? ???????? (??????????)
  • ??????? ?? ?????????? ????? ???? ? ??????
  • book2 booklast() bookposition()lt3
  • ??????? ?? ???????? ????????? (????
    ????????????? ?? ??????? ???????)
  • bookcity??????
  • bookpricegt250
  • ??????? ?? ???????? ?????????
  • //book_at_langrus/title
  • ??????? ??????????? ? ???? ????, ?????
    ???????? ?????
  • book1/author vs. book/author1
Write a Comment
User Comments (0)
About PowerShow.com