Loading methods in PHP DOMDocument class DOMDocument extends DOMNode {... mixed load ( string $filename.

Slides:



Advertisements
Similar presentations
Transforming XML XMLNamespaces, XSLT. XML Namespaces Sometimes it is necessary to mix XML elements –Different types of content –Use of markup to convey.
Advertisements

Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
Passing Streams to Functions. Passing Streams to Functions One Rule: always pass a stream as a reference.
Java Server Pages (JSP)
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
4/17/2015Comp Sci 3461 XML_2 Ch. 7. 4/17/2015Comp Sci 3462 XML Vocabularies  MathML  An application to parse, render, and edit MathML: Amaya 
XSLT (eXtensible Stylesheet Language Transformation) 1.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
Jennifer Widom Querying XML XSLT. Jennifer Widom XSLT Querying XML Not nearly as mature as Querying Relational  Newer  No underlying algebra Sequence.
Lecture 16. the xsl:variable element The format of the xsl:variable element is or or It tells the XSLT processor to –instantiate the variable with the.
XSLT Stylesheets Some more advanced examples (adapted from the Edinburgh LT site)
Lecture 10. Back to the table example We can now return to considering in detail the first XSLT style-sheet we saw –The one which, when applied to the.
PHP and the DOM There was some experimental support for the DOM in PHP 4 But it is only with PHP 5 that support appears to have stabilized At present,
Rendering XML documents with XSL The most powerful approaches to rendering XML documents involve using XSL (eXtensible Stylesheet Language) XSL enables.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
Lecture 17. Side remark: for-each equivalence again Second-hand cars Item Model Engine Size Price
Lecture 12. Default Processing in XSLT The default processing in XSLT is to process the XPath root node The default processing for various node types.
IS 1181 IS 118 Introduction to Development Tools Chapter 5 Reusing Code.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
1 Copyright (c) [2002]. Roger L. Costello. All Rights Reserved. Using Extension Elements and Extension Functions with XSLT and XPath Roger L. Costello.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
More on XSLT. More on XSLT variables Earlier we saw two ways to associate a value with a variable  A variable whose value is the empty string, for example.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools Leonidas Fegaras.
Advanced XSL Concepts Transforming External Data Sources Vinit Varghese Implementation Manager, OmniUpdate.
JSP Standard Tag Library
15 November 2005Linking Outside the Box1 Cross referencing between XML documents Bob Stayton Sagehill Enterprises
XML for E-commerce III Helena Ahonen-Myka. In this part... n Transforming XML n Traversing XML n Web publishing frameworks.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
XML and its applications: 4. Processing XML using PHP.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
Session II Chapter 2 – Chapter 2 – XSLhttp://
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
The PHP5-DOM API. Outline Create DOM Object Load XML from a file/string Manipulate DOM Object – Search/Delete/Create/Replace DOMNode – Set/Get DOMAttribute.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
CSE3201/CSE4500 Information Retrieval Systems XSLT – Part 2.
Set 8.5: XSLT Continued IT452 Advanced Web and Internet Systems.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
A presentation by Robin Upton ( ) ‏ latest version at Attribution – NonCommercial - ShareAlike FF 4 :
Lecture 17. Side remark: for-each equivalence again Second-hand cars Item Model Engine Size Price
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
Lecture 11 XSL Transformations (part 1: Introduction)
Openadaptor XML Support Using openadaptor for XML processing Oleg Dulin,
Yet more on XSLT. Regular expression handling in EXSLT We saw that the EXSLT extensions are divided into a group of modules, each of which has its own.
An OO schema language for XML SOX W3C Note 30 July 1999.
MEDIN Standards Workshop Using ESRI ARC 10 to create metadata.
XML XSLT Variables & parameters Feb 20, Variables ● More like an algebraic variable than a programming variable ● Think of it as similar to a constant.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
CSE 6331 © Leonidas Fegaras XML Tools1 XML Tools.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
XP New Perspectives on XML, 2 nd Edition Tutorial 7 1 TUTORIAL 7 CREATING A COMPUTATIONAL STYLESHEET.
CSE3201/CSE4500 Information Retrieval Systems XSLT – Part 2.
Accessing XML Documents Using DOM ©NIITeXtensible Markup Language/Lesson 8/Slide 1 of 23 Objectives In this lesson, you will learn to: * Use XML DOM objects.
21. PHP Classes To define a class, use the keyword class followed by the name and a block with the properties and method definitions Properties are declared.
XML - XSLT © 2015 University of Greenwich 1 XML Processing with XSLT e Xtensible Stylesheet Language Transforms Dr Kevin McManus
XSLT, XML Schema, and XPath Matt McClelland. Introduction XML Schema ▫Defines the content and structure of XML data. XSLT ▫Used to transform XML documents.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
Lecture Transforming Data: Using Apache Xalan to apply XSLT transformations Marc Dumontier Blueprint Initiative Samuel Lunenfeld Research Institute.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
Session IV Chapter 14 – Chapter 14 – XSLThttp://
Displaying XML Data with XSLT
Namespace Review 29-Dec-18.
CS 431 – February 28, 2005 Carl Lagoze – Cornell University
Querying XML XSLT.
Presentation transcript:

Loading methods in PHP DOMDocument class DOMDocument extends DOMNode {... mixed load ( string $filename [, int $options = 0 ] ) mixed loadXML ( string $source [, int $options = 0 ] ) bool loadHTML ( string $source ) bool loadHTMLFile ( string $filename )... } We have seen that load() loads XML from a file loadXML() loads XML from a string loadHTML() loads HTML from a string –Unlike loading XML, HTML does not have to be well-formed to load load HTMLFile() loads HTML from a string –Unlike loading XML, HTML does not have to be well-formed to load

XSLTProcessor class in PHP XSLTProcessor { string getParameter ( string $namespaceURI, string $localName ) bool hasExsltSupport ( void ) void importStylesheet ( object $stylesheet ) void registerPHPFunctions ([ mixed $restrict ] ) bool removeParameter ( string $namespaceURI, string $localName ) bool setParameter ( string $namespace, string $name, string $value ) bool setProfiling ( string $filename ) string transformToXML ( DOMDocument $doc ) DOMDocument transformToDoc ( DOMNode $doc ) int transformToURI ( DOMDocument $doc, string $uri ) } We have already used the blue methods above

transform methods in PHP XSLTProcessor class XSLTProcessor {... string transformToXML ( DOMDocument $doc ) DOMDocument transformToDoc ( DOMNode $doc ) int transformToUri ( DOMDocument $doc, string $uri ) } transformToXML() transforms the source DOMDocument to a string transformToDoc() transforms the source DOMDocument to a DOMDocument transformToUri() transforms the source DOMDocument to the URI specified in the string –For example, $processor->transformToUri($xmldoc,'output.html'); places the output from the transformation in a file called output.html

Global parameters for XSL stylesheets XSLT allows parameters whose scope is the entire stylesheet –Default values can be set for these parameters –External values can be passed to these parameters –If external values are passed, these override the default values The values of these parameters can then control the form of processing performed by the stylesheet

Global parameters in XSLT, Example Stylesheet below has a global parameter, called infoWanted, to which is gives a default value that can be over-ridden by an externally-set value Depending on value of parameter, stylesheet outputs either the names or the ages of the people in the XML document which is being processed

Global parameters in XSLT, Example Suppose stylesheet on previous slide is in demo304.xsl demo304.php applied it to the XML document in demo304.xml Different output is given, depending on value of query string given to demo304.php

parameter methods in PHP XSLTProcessor class XSLTProcessor {... bool setParameter ( string $namespace, string $name, string $value ) string getParameter ( string $namespaceURI, string $localName ) bool removeParameter ( string $namespaceURI, string $localName ) } setParameter() sets the value of parameter to be used in subsequent transformations; if the parameter doesn't exist in stylesheet, it will be ignored getParameter() gets a parameter if previously set by setParameter() removeParameter() removes a parameter, if set; this will make the processor use default value for the parameter as specified in the stylesheet

Profiling An XSLT profiling tool determines –which templates were called –how many times –how much time was spent executing them This information may help in re-writing the stylesheet to improve its speed of execution

profiling method in PHP XSLTProcessor class XSLTProcessor {... bool setProfiling ( string $filename )... } setProfiling() specifies the file to which the profiling information should be written when a stylesheet is executed Example $proc->setProfiling('profiling.txt'); specifies that profiling results will be written to the file called profiling.txt