6 Pages

lecture28

Course: CS 3308, Fall 2004
School: Colorado
Rating:
 
 
 
 
 

Word Count: 1420

Document Preview

Lecture Todays Lecture 28: XSLT Kenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2003 Introduce XSLT background concepts examples XSLT stands for XML Stylesheet Language, Transformations December 1, 2003 University of Colorado, 2003 2 Transformations XSLT was developed as part of the XML stylesheet standards effort Whats a stylesheet? A stylesheet is a device for specifying...

Register Now

Unformatted Document Excerpt

Coursehero >> Colorado >> Colorado >> CS 3308

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Lecture Todays Lecture 28: XSLT Kenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2003 Introduce XSLT background concepts examples XSLT stands for XML Stylesheet Language, Transformations December 1, 2003 University of Colorado, 2003 2 Transformations XSLT was developed as part of the XML stylesheet standards effort Whats a stylesheet? A stylesheet is a device for specifying presentation information independent of content For instance, in Microsoft Word, you can specify that a heading should appear in 36pt Times bold font with double spacing above and below Then all headings will appear that way, no matter what the heading actually says Stylesheets in HTML The Web already has a stylesheet language called cascading stylesheets or CSS This mechanism allows formatting information to be associated with HTML tags, such as <H1> or <P> without using <font> or <b> tags In the last lecture, we asked the question, if CNN switched to using XML in their webpage, how would they associate formatting information with a tag such as <headline>? December 1, 2003 University of Colorado, 2003 3 December 1, 2003 University of Colorado, 2003 4 XSL and XSLT The answer, of course, is with the XML Stylesheet language (XSL) Problem: the XSL standards group was having a hard time agreeing on a mechanism for specifying formatting information However, they were making progress with the transformation part of the specification This part specifies mechanisms for transforming XML to other structures, such as XML->XML, XML->HTML, XML>PDF, etc. XSLT Plus, they noticed that a large part of their users were using the transformation part of the XSL specification to transform XML to HTML and then using CSS to format the resulting document As such, XSLT was born, the standards group focused on finishing the transformation part of the specification first and published it as XSLT (XSL has since been completed) December 1, 2003 University of Colorado, 2003 6 December 1, 2003 University of Colorado, 2003 5 Background To understand XSLT, you must view XML documents as tree structures XSLT provides rules to transform one tree into another tree It traverses the source tree in an order dictated by the stylesheet and creates the destination tree using the rules of the stylesheet December 1, 2003 University of Colorado, 2003 7 Example of viewing XML as a tree <!DOCTYPE gradebook [ <!ELEMENT gradebook (class, student*)> <!ELEMENT class (name, studentsEnrolled)> <!ATTLIST class semester CDATA #REQUIRED> <!ELEMENT name (#PCDATA)> <!ELEMENT studentsEnrolled (#PCDATA)> <!ELEMENT student (name, grade*)> <!ELEMENT grade (#PCDATA)> <!ATTLIST grade name CDATA #REQUIRED> gradebook class student name student name grade grade grade name ]> grade grade studentsEnrolled December 1, 2003 University of Colorado, 2003 8 Background: XPath XSLT uses a separate standard, called XPath, to help select nodes in an XML document For instance gradebook/student/grade is an XPath expression that selects all grade nodes in the example on the previous slide More XPath examples //grade start at the root node and find all grade nodes gradebook/student[2] select the second student node under gradebook For more information on XPath see < http://www.w3.org/TR/xpath> You will need to know how to create simple XPath expressions (like the ones shown above) to complete lab 10 XPath can even select attributesfor example.. gradebook/student/grade[@name=hw3] will select only those grade nodes that have a value of HW3 for their name attribute December 1, 2003 University of Colorado, 2003 9 December 1, 2003 University of Colorado, 2003 10 XSLT, the details XSLT transforms XML documents using stylesheets that are themselves XML documents All XSLT stylesheets have the following form <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> templates and transformation rules go here Stylesheets Stylesheets consist of templates that match nodes of the source XML tree (i.e. document) Each template then specifies what should be created in the destination tree (or document) A template looks like this: <xsl:template match="/"> <html> <head> <title>Grade Book</title> </head> <xsl:apply-templates/> The tag is called xsl:template and it has an attribute called match that takes an XPath expression If a node matches this expression (in this case the root note) then the associated text appears in the destination document (except for the xsl:apply-templates part) 12 </xsl:stylesheet> You can use this template when writing your own XSL Stylesheet in Lab 10 </html> </xsl:template> December 1, 2003 University of Colorado, 2003 11 December 1, 2003 University of Colorado, 2003 XSLT Architecture HTML XML File XSLT Processor PDF XML XSLT XSLT XSLT Stylesheet Stylesheet Stylesheet same The XML File can be transformed into XML, HTML, PDF, etc. just by using a different stylesheet University of Colorado, 2003 13 More Details Stylesheet processing XSLT processor is handed a document and a stylesheet It starts a (breadth-first) traversal at the root node and checks to see if there is a template match If so, it applies the template and looks for an xsl:applytemplates element If such an element exists, it continues the traversal if no such element exists, the traversal stops If not, it traverses down the tree looking for a template match with some other node of the tree December 1, 2003 December 1, 2003 University of Colorado, 2003 14 XSL:apply-templates The apply-templates tag determines if an XSLT processor continues traversing a document once a template match has occurred The apply-templates tag can contain an attribute called select which can specify the specific children to continue traversing using an XPath expression <xsl:apply-templates> All children traversed Processing in XSLT stylesheets XSLT is very powerful We cannot cover the entire standard So, the following slides cover only a small subset of the tags that can be placed in an XSLT stylesheet For a good reference on XSLT see: <http://www.zvon.org/xxl/XSLTreference/Output/index.html> <xsl:apply-templates select=grade[@name=HW4]> All grade nodes with a name attribute equal to HW4 traversed (any other nodes skipped during the subsequent traversal) December 1, 2003 University of Colorado, 2003 15 December 1, 2003 University of Colorado, 2003 16 Repetition <xsl:for-each select = item> Do something here ... Repetition Example <xsl:template match="/"> <html> <head> <title>Grade Book</title> </xsl:for-each> Again, the select attribute is an XPath expression that selects the nodes to iterate over </head> <body> <UL> <xsl:for-each select=student/grade> <LI>Grade: <xsl:value-of select="./></LI> </xsl:for-each> </UL> </body> </html> </xsl:template> December 1, 2003 University of Colorado, 2003 17 December 1, 2003 University of Colorado, 2003 18 Example Explained This example creates a simple HTML file that contains a list of all the grades received by students in the gradebook Note: It did not list student names for each set of grades but it could have easily done so. However the student/grade XPath expression in the for-each select attribute skipped past the student nodes and selected only grade nodes The value-of element pulled the value of the grade element (e.g. the grade) into the HTML file The resulting HTML file is shown on the next slide December 1, 2003 University of Colorado, 2003 19 Generated HTML File <html> <head> <title>Grade Book</title> In the browser, this file would look like this: Grade Book Grade: 10 Grade: 7 Grade: 6 Grade: 10 </head> <body> <UL> <LI>Grade: 10<LI> <LI>...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Colorado - CS - 6448
Credit where Credit is DueLecture 2: Software Engineering (a review)Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Some material presented in this lecture is taken from chapter 1 of Maciaszeks Requireme
Colorado - CS - 6448
Goals for this Lecture Lecture 3: Life Cycles and Design MethodsKenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003Review traditional software engineering life cycles Introduce the notion of an objectoriented
Colorado - CS - 6448
Credit where Credit is DueLecture 7: Requirements ElicitationKenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003Some material presented in this lecture is taken from section 3 of Maciaszeks Requirements Analy
Colorado - CS - 6448
Goals for this LectureLecture 9: Use CasesKenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Define Use Cases Review UML Notation for Use Cases Look at a variety of Use Case examplesfrom the booksWriting Eff
Colorado - CS - 6448
Goals for this LectureLecture 10: Use Case PatternsKenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003Look at a number of Use Case Patternsfrom the bookPatterns for Effective Use Casesby Steve Adolph and P
Colorado - CS - 6448
Credit where Credit is DueLecture 11: Requirements Specification Some material presented in this lecture is taken from section 4 of Maciaszeks Requirements Analysis and System Design. Addison Wesley, 2000Kenneth M. Anderson Object-Oriented Analys
Colorado - CS - 6448
Credit where Credit is DueLecture 17: Maciaszeks Take on Design Some material presented in this lecture is taken from section 6 of Maciaszeks Requirements Analysis and System Design. Addison Wesley, 2000Kenneth M. Anderson Object-Oriented Analysi
Colorado - CS - 6448
Credit where Credit is DueLecture 18: Responsibility-Driven Design, Part 1Some material presented in this lecture is taken from Object Design: Roles, Responsibilities, and Collaborations. Addison Wesley/Pearson Education, 2003. ISBN 0-201-37943-0
Colorado - CS - 6448
Credit where Credit is DueLecture 19: Responsibility-Driven Design, Part 2 Some material presented in this lecture is taken from Object Design: Roles, Responsibilities, and Collaborations. Addison Wesley/Pearson Education, 2003. ISBN 0-201-37943-0
Colorado - CS - 6448
Credit where Credit is DueLecture 23: Agile Design and Extreme ProgrammingKenneth M. Anderson Software Methods and Tools CSCI 6448 - Fall Semester, 2003 The material for this lecture is based on content from Agile Software Development: Principles,
Colorado - CS - 6448
Last Lecture Lecture 26: Design Patterns (part 2)Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003Design PatternsBackground and Core Concepts ExamplesSingleton, Factory Method, and AdapterApril 10, 2003
Colorado - CS - 6448
Credit where Credit is Due Lecture 29: Test-Driven DevelopmentKenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003Some of the material for this lecture is taken from Test-Driven Development by Kent Beck; as suc
Colorado - CS - 3308
Lab #1 Installing a System Due Friday, September 6, 2002Name: Lab Time: Grade: /10The Steps of Installing a System Today you will install a software package. Implementing a software system is only part of a software engineers job. Once implemente
Colorado - CS - 3308
Lab #3 Automating Installation &amp; Introduction to Make Due in Lab, September 17, 2003Name: Lab Time: Grade: Error Checking In this lab you will be writing a shell script to automate the installation of a system. The system that your shell script wil
Colorado - CS - 3308
Lab #7 Testing Due In Lab, October 22, 2003 Name: Lab Time: Grade: Testing Today you will be testing a program to expose failures. In Homework 7, you familiarized yourself with the operation of a quick sort program, quick-okay. Now that you know the
Colorado - CS - 3308
Lab #10 XML and XSLT Due in Lab, December 3, 2003 Name: Lab Time: Grade: /10In this lab, you will gain experience working with XML and XSLT. XML is a language for creating markup languages. A markup language is any language that includes both text
Colorado - CS - 3308
Notes on Using gdb, the GNU Debugger Benjamin Zorn (with small modications by Kenneth M. Anderson for CSCI 3308)A symbolic debugger can make writing and debugging programs much easier. The GNU debugger can be used to debug programs compiled with the
Colorado - CS - 3308
Software Testing Notebook Worksheet #1 Functional Testing Due: October 31, 2003 Name: Lab Time: Grade: /75On my honor, as a University of Colorado at Boulder student, I have neither given nor received unauthorized assistance on this work. Signature
Colorado - CS - 3308
Software Testing Notebook Worksheet #2 Structural Testing Due: Friday, November 7, 2003 Name: Lab Time: Grade: /50On my honor, as a University of Colorado at Boulder student, I have neither given nor received unauthorized assistance on this work. S
Colorado - CS - 3308
Software Testing Notebook Worksheet #3 Automating Testing &amp; Fixing Bugs Due: November 14, 2003 Name: Lab Time: Grade: /75On my honor, as a University of Colorado at Boulder student, I have neither given nor received unauthorized assistance on this
Colorado - CS - 5828
Todays LectureThe Mythical Man-MonthKenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester, 2001 (Guest Lecture) Discuss first four chapters of The Mythical Man-Month The Tar Pit The Mythical Man-Month The Surgica
Colorado - CS - 5828
Todays Lecture Discuss Software Life CyclesSoftware Life CyclesKenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester, 2001 (Guest Lecture) Why do we need them? What types exist? Code and Fix (hacking) Waterfa
Colorado - CS - 5828
Todays Lecture The Cathedral and the BazaarKenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester, 2001 Guest Lecture Discuss Background of the Paper Discuss Raymonds Rules Open Discussion on the Open-Source Approach
Colorado - CS - 5828
Todays Lecture Extreme ProgrammingKenneth M. Anderson Foundations of Software Engineering CSCI 5828 - Spring Semester, 2001 Guest Lecture Discuss aspects of the Extreme Programming Model As presented in Extreme Programming Explained: Embrace Chan
Colorado - CS - 3308
Lab #2 Find and Grep Due in Lab, September 8, 2004 Name: Lab Time: Grade: Find The nd command is used to locate les in a le system. The nd command starts at a single directory and descends recursively into all of its subdirectories to locate les. The
Colorado - CS - 3308
Lab #3 Automating Installation &amp; Introduction to Make Due in Lab, September 15, 2004Name: Lab Time: Grade: Error Checking In this lab you will be writing a shell script to automate the installation of a system. The system that your shell script wil
Colorado - CS - 3308
Todays Lecture Lecture 2: No Silver BulletKenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2004August 27, 2004 University of Colorado, 2004 2Discuss No Silver Bullet paper Brooks reflections on it after nine years
Colorado - CS - 3308
Todays Lecture Lecture 6: Build ManagementKenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2004September 10, 2004 University of Colorado, 2004 2Discuss Build Management Introduce makeBuild ManagementDuring the impleme
Colorado - CS - 3308
Todays Lecture Lecture 7: Make MacrosKenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2004Brief review of make Explore make macros in more detailNote: when you see macro think variableBrooks Corner: The Mythical Man-Mont
Colorado - CULTER - 06
CU Mountain006 Research StationWinter 2 Ecology
Colorado - ASTR - 5770
New InflationAmy Bender 05/03/2006Inflation Basics Perturbations from quantum fluctuations of scalar field Fluctuations are: Gaussian Scale Invariant Spectrum (almost) k3P(k) ~ constant Adiabatic Scalar &amp; Tensor Matter/radiation anisotrop
Colorado - ASTR - 5770
HST Key Project on the Extragalactic Distance ScalePresentation by Alaine Ginocchio May 5, 2006HST Key ProjectMeasuring an accurate value of H0 was one of the motivating reasons for building NASA/ESA Hubble Space Telescope (HST).Measurement
Colorado - ASTR - 5770
Holographic Dark EnergyPreety Sidhu 5 May 2006Black Holes and Entropy Black holes are maximal entropy objects Entropy of a black hole proportional to surface area of event horizon Max entropy for volume of space goes as bounding surface area, n
Colorado - ASTR - 5770
The Sunyaev-Zeldovich EffectJason Glenn APSHistorical Perspective Physics of the SZ Effect -Previous Observations &amp; Results Bolocam Imminent Experiments Future Work ReferencesCMB discovered in 1964 by Penzias and Wilson COBE 1989: perfect blackbo
Wisconsin - CS - 0601
Proximal Plane ClassificationKDD 2001 San Francisco August 26-29, 2001Glenn Fung &amp; Olvi MangasarianData Mining InstituteUniversity of Wisconsin - Madison Second Annual Review June 1, 2001Key ContributionsFast new support vector machine class
Wisconsin - REV - 0601
Proximal Plane ClassificationKDD 2001 San Francisco August 26-29, 2001Glenn Fung &amp; Olvi MangasarianData Mining InstituteUniversity of Wisconsin - Madison Second Annual Review June 1, 2001Key ContributionsFast new support vector machine class
St. Johns River Community College - CS - 0601
Proximal Plane ClassificationKDD 2001 San Francisco August 26-29, 2001Glenn Fung &amp; Olvi MangasarianData Mining InstituteUniversity of Wisconsin - Madison Second Annual Review June 1, 2001Key ContributionsFast new support vector machine class
Wisconsin - CS - 0600
Concave Minimization for Support Vector Machine ClassifiersUnlabeled Data Classification &amp; Data SelectionGlenn Fung O. L. MangasarianPart 1: Unlabeled Data Classifications ssssGiven a large unlabeled dataset Use a k-Median clustering al
Wisconsin - REV - 0600
Concave Minimization for Support Vector Machine ClassifiersUnlabeled Data Classification &amp; Data SelectionGlenn Fung O. L. MangasarianPart 1: Unlabeled Data Classifications ssssGiven a large unlabeled dataset Use a k-Median clustering al
St. Johns River Community College - CS - 0600
Concave Minimization for Support Vector Machine ClassifiersUnlabeled Data Classification &amp; Data SelectionGlenn Fung O. L. MangasarianPart 1: Unlabeled Data Classifications ssssGiven a large unlabeled dataset Use a k-Median clustering al
Wisconsin - ECE - 756
Linear Programming and CPLEXTing-Yuan Wang Advisor: Charlie C. ChenDepartment of Electrical and Computer Engineering University of Wisconsin-MadisonFeb. 22 2000CPLEX Optimization Options: Primal, Dual Simplex Methods Network Flow Problems MI
St. Johns River Community College - ECE - 756
Linear Programming and CPLEXTing-Yuan Wang Advisor: Charlie C. ChenDepartment of Electrical and Computer Engineering University of Wisconsin-MadisonFeb. 22 2000CPLEX Optimization Options: Primal, Dual Simplex Methods Network Flow Problems MI
Wisconsin - ECE - 03
Artifact and Textured region Detection- Vishal BangardOutline Need for artifact and textured region detection Aim of the project Techniques used in the imaging world Approaches used Results ConclusionWhy do artifact detection ? A lot of
Wisconsin - ECE - 738
Artifact and Textured region Detection- Vishal BangardOutline Need for artifact and textured region detection Aim of the project Techniques used in the imaging world Approaches used Results ConclusionWhy do artifact detection ? A lot of
St. Johns River Community College - ECE - 03
Artifact and Textured region Detection- Vishal BangardOutline Need for artifact and textured region detection Aim of the project Techniques used in the imaging world Approaches used Results ConclusionWhy do artifact detection ? A lot of
St. Johns River Community College - ECE - 738
Artifact and Textured region Detection- Vishal BangardOutline Need for artifact and textured region detection Aim of the project Techniques used in the imaging world Approaches used Results ConclusionWhy do artifact detection ? A lot of
Wisconsin - ECE - 03
Unequal Error Protection for Video Transmission over Wireless ChannelsECE738 Project PresentationChang, Hong Hong 05/09/20031OutlineUnequal Error Protection/ Unequal Loss Protection Problem Formulation Channel Model RS code Theoretical Res
Wisconsin - ECE - 738
Unequal Error Protection for Video Transmission over Wireless ChannelsECE738 Project PresentationChang, Hong Hong 05/09/20031OutlineUnequal Error Protection/ Unequal Loss Protection Problem Formulation Channel Model RS code Theoretical Res
St. Johns River Community College - ECE - 03
Unequal Error Protection for Video Transmission over Wireless ChannelsECE738 Project PresentationChang, Hong Hong 05/09/20031OutlineUnequal Error Protection/ Unequal Loss Protection Problem Formulation Channel Model RS code Theoretical Res
St. Johns River Community College - ECE - 738
Unequal Error Protection for Video Transmission over Wireless ChannelsECE738 Project PresentationChang, Hong Hong 05/09/20031OutlineUnequal Error Protection/ Unequal Loss Protection Problem Formulation Channel Model RS code Theoretical Res
Wisconsin - ECE - 03
Portraiture MorphingPresented by Fung, Chau-ha JeniceOutline Problem Statement Prior Art: Portraiture Morphing Approaches Results Conclusion Future WorksProblem Statement Image morphing = Image metamorhposis Creating a smooth transfor
Wisconsin - ECE - 738
Portraiture MorphingPresented by Fung, Chau-ha JeniceOutline Problem Statement Prior Art: Portraiture Morphing Approaches Results Conclusion Future WorksProblem Statement Image morphing = Image metamorhposis Creating a smooth transfor
St. Johns River Community College - ECE - 03
Portraiture MorphingPresented by Fung, Chau-ha JeniceOutline Problem Statement Prior Art: Portraiture Morphing Approaches Results Conclusion Future WorksProblem Statement Image morphing = Image metamorhposis Creating a smooth transfor
St. Johns River Community College - ECE - 738
Portraiture MorphingPresented by Fung, Chau-ha JeniceOutline Problem Statement Prior Art: Portraiture Morphing Approaches Results Conclusion Future WorksProblem Statement Image morphing = Image metamorhposis Creating a smooth transfor
Wisconsin - ECE - 03
ECE 738 ProjectBrain segmentation and Phase unwrapping in MRI dataJongHoon LeeOutline Nature of fast MRI: EPI &amp; Field Inhomogeneity Background problem Image Distortion Specific problems a) Brain Segmentation b) Phase Unwrapping Goal Appro
Wisconsin - ECE - 738
ECE 738 ProjectBrain segmentation and Phase unwrapping in MRI dataJongHoon LeeOutline Nature of fast MRI: EPI &amp; Field Inhomogeneity Background problem Image Distortion Specific problems a) Brain Segmentation b) Phase Unwrapping Goal Appro
St. Johns River Community College - ECE - 03
ECE 738 ProjectBrain segmentation and Phase unwrapping in MRI dataJongHoon LeeOutline Nature of fast MRI: EPI &amp; Field Inhomogeneity Background problem Image Distortion Specific problems a) Brain Segmentation b) Phase Unwrapping Goal Appro
St. Johns River Community College - ECE - 738
ECE 738 ProjectBrain segmentation and Phase unwrapping in MRI dataJongHoon LeeOutline Nature of fast MRI: EPI &amp; Field Inhomogeneity Background problem Image Distortion Specific problems a) Brain Segmentation b) Phase Unwrapping Goal Appro
Wisconsin - ECE - 03
ECE738 Presentation of Project SurveyA survey of image-based biometric identification methods: Face, finger print, iris, and othersPresented by: David LinOutline Problems and motivations Different identification methods Face Recognition Fing
Wisconsin - ECE - 738
ECE738 Presentation of Project SurveyA survey of image-based biometric identification methods: Face, finger print, iris, and othersPresented by: David LinOutline Problems and motivations Different identification methods Face Recognition Fing
St. Johns River Community College - ECE - 03
ECE738 Presentation of Project SurveyA survey of image-based biometric identification methods: Face, finger print, iris, and othersPresented by: David LinOutline Problems and motivations Different identification methods Face Recognition Fing