124.11.lec14

124.11.lec14 - Click to edit Master subtitle style 1/10/09...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style 1/10/09 Dan Jurafsky Lecture 14: XPath, XSLT Slides from Daniela Florescu, Donald Kossmann, Miles Efron, Dan Suciu, Matt Hottell, Minos Garofalakis, and Joe Hellerstein. Copyright all of them. Slide from Chris Manning's 276 class XML Last time: Introduction to XML Schemas DTD This time: Doing stuff with XML documents Slide from Chris Manning's 276 class Letter to Twitter Slide from Chris Manning's 276 class Twitter mailing address Slide from Chris Manning's 276 class Twitter address Slide from Chris Manning's 276 class Web Search Today Web document: bag of words HTML: presentation language Difficult to identify structure/semantics <I> Twitter<BR> 795 Folsom St<BR> San Francisco, CA <BR> </I> <I> Terriyaki sauce<BR> One egg<BR> New York steak<BR> </I> Slide from Chris Manning's 276 class A first step - XML Focus on structure/semantics instead of layout <I> Twitter<BR> 795 Folsom St<BR> San Francisco, CA<BR> </I> <address> <company name=Twitter> <street>795 Folsom St</street> <city>San Francisco</city> <state>CA</state> </address> Twitter mailing address address[.*name=Twitter] Slide from Chris Manning's 276 class Step 2: Manipulating XML files XSLT e X tensible S tylesheet L anguage T ransformations A way to derive dynamic views of information A language used to transform a given XML document into another document Xpath address[.*name=Twitter] A way of specifying elements of an XML document. Slide from Chris Manning's 276 class Why might we want to transform XML documents? Rendering XML into other formats for viewing: HTML LaTeX PDF Portable devices Deriving alternate views of information for differing contexts. Information Extraction from XML-structured documents Slide from Chris Manning's 276 class XSL Processing XML XSL ??? XSL Process or Slide from Chris Manning's 276 class XSLT Stylesheets An XML doc itself Root element is stylesheet. Simplest possible stylesheet just has that root (and a namespace definition): <?xml version="1.0"?> <xsl:stylesheet version="1.0 xmlns:xsl="http://www.w3.org/1999/XSL/Transfor m"> Slide from Chris Manning's 276 class What does that empty stylesheet http://cs124.stanford.edu/xml/names.xml http://cs124.stanford.edu/xml/empty.xsl http://www.ibiblio.org/mefron/xml/xsl/form.h Slide from Chris Manning's 276 class An XSLT program < xsl:stylesheet version="1.0" xmlns:xsl= http://www.w3.org/1999/XSL/Transform> < xsl:template ..> </ xsl:template > < xsl:template ..> </ xsl:template > Each template rule specifies how certain nodes from the input XML doc have to be reformatted in the output Slide from Chris Manning's 276 class XSLT template rules An element named xsl:template Which has an attribute named match That contains a pattern And a template that is instantiated and output when the...
View Full Document

This document was uploaded on 06/01/2011.

Page1 / 106

124.11.lec14 - Click to edit Master subtitle style 1/10/09...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online