חלק 3: מבוא ל- XPath

22
Spring 2005 1 קקק3 : - קקקק קXPath XML Path Language

description

חלק 3: מבוא ל- XPath. XML Path Language. מסמך דוגמא. < bib > < book price =“55”> < publisher >Addison-Wesley < author >Serge Abiteboul < author > < first-name >Rick - PowerPoint PPT Presentation

Transcript of חלק 3: מבוא ל- XPath

  • Spring 2005* 3: - XPathXML Path Language

  • Spring 2005* Addison-Wesley Serge Abiteboul Rick Hull Victor Vianu Foundations of Databases 1995 Freeman Jeffrey D. Ullman Principles of Database and Knowledge Base Systems 1998

  • Spring 2005* XML bibbookbookpublisherauthor. . . .Addison-WesleySerge Abiteboul price=55

  • Spring 2005* XPath /bib/book/year:19951998

    /bib/paper/year: ( paper)

  • Spring 2005* ( Kleene )//author:Serge Abiteboul

    Rick Hull

    Victor VianuJeffrey D. Ullman

    /bib//first-name:Rick 4

  • Spring 2005* text() node()

    /bib/book/author/text() .Serge Abiteboul Victor Vianu Jeffrey D. Ullman

    Rick Hull , author .

  • Spring 2005* - wildcard//author/*:RickHull

    -wildcard * .

  • Spring 2005* /bib/book/@price: 55-@ -@price price@*

  • Spring 2005* /bib/book/author[first-name = Rick]: RickHull

    [ ] Rick.

    : ?/bib/book[ year >= 2000] , year .

  • Spring 2005* //book[@price
  • Spring 2005* (existential)/bib/book/author[first-name][address[zip][city]]/last-name: (last-name) (zip) (city). [first-name] author first-name .: ( )./bib/book/author[first-name][not(last-name)]

  • Spring 2005*/bib/book[2] - /bib/book[position() = 2] position() .//author[last()] last() . ?//author[1][2]//author[2][1]

  • //author[1] Serge AbiteboulJeffery D. Ullman//author[1][2] , //author[2] -//author[2][1]

    Rick Hull

    Spring 2005*

  • Spring 2005* - /bib//*[name()=book] - /bib//bookname() ./bib/book[count(author)>1]count() .id(a0130353000)id() ID " .

  • Spring 2005*XPath ( axes) 13 :ancestor:: - ancestor-or-self:: - attribute:: - () child:: - descendant:: - descendant-or-self:: - following:: -

  • Spring 2005* - following-sibling:: - namespace:: - namespace parent:: - ( ) preceding:: - preceding-sibling:: - self:: -

  • Spring 2005*

  • Spring 2005*-

  • Spring 2005*//author/descendant-or-self::node()/child::zip //author//zip //author/descendant::zip ?//book/publisher/parent::*/author//book[author[position()
  • Spring 2005* - ?//book[ not(year < //book/year) ] ? ./bib/book/author[.=../following-sibling::*/author and not(.=../preceding-sibling::*/author)]

  • -DTD, GID, date, name, country, color, no, status, from, to, type PCDATA. XPath 7 99. .

    Spring 2005*

  • - 99//game[GID=99] 7 99//game[GID=99]/move[no=7]/piece/color 7 99//game[GID=99]/player[color = ../move[no=7]/piece/color]/name

    Spring 2005*

    ***********