CS257
Chris Pollett
Sep 2, 2020
doc("winecellar.xml")/winecellar/winematches all wine nodes (and their contents) in the winecellar.xml file which start from the whole document, then immediately go through a winecellar sub-tag then have a wine tag.
doc("winecellar.xml")/winecellar/wine[2]
doc("winecellar.xml")/winecellar/wine[price > 20]/namereturns the names of all wine nodes with price attribute greater than 20.
URL: https://apnews.com/apf-topnews Channel: //article[contains(@class, 'feed')] Item Separator: //div[contains(@class, 'FeedCard')] Title: //div[contains(@class, 'CardHeadline')]//h1 Description: //div[contains(@class, 'content')] Link: //a[contains(@data-key, 'story-link')]
<wine> <name>Meghhetti White</name> <year>2010e</year> </wine>would be represented by the figure above.
start document start element: wine start element: name text: Meneghetti end element: name start element: year text: 2010 end element: year end element: wine end document
<database> <row><column> data </column> <column> data ... </column> <column> data </column></row> <row><column> data </column> <column> data ... </column> <column> data </column></row> ... </database>or in the form:
<database> <row column_1="data" column_2="data" ... column_n="data"/> <row column_1="data" column_2="data" ... column_n="data"/> ... </database>