Download presentation
Presentation is loading. Please wait.
Published byHunter Jordan Modified over 9 years ago
1
4/17/2015Comp Sci 3461 XML_2 Ch. 7
2
4/17/2015Comp Sci 3462 XML Vocabularies MathML An application to parse, render, and edit MathML: Amaya http://www.w3.org/Amaya/User/BinDist.html http://www.w3.org/Amaya/User/BinDist.html
3
4/17/2015Comp Sci 3463
4
4/17/2015Comp Sci 3464 Rendering with Amaya Mathml1.xml Mathml2.xml Mathml3.xml
5
4/17/2015Comp Sci 3465 Mathml1.xml <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"> 2 + 3 = 5
6
4/17/2015Comp Sci 3466 Mathml2.xml 3 ⁢ x 2 + x − 2 x = 0
7
4/17/2015Comp Sci 3467 Mathml3.xml ∫ 0 1 − y 4 ⁢ x 2 + y δ x
8
4/17/2015Comp Sci 3468 Rendering with Firefox and IE Download and install additional fonts for Firefox www.mozilla.org/projects/mathml/fonts/ or www.mozilla.org/projects/mathml/fonts/ or www.mozilla.org/projects/mathml/fonts/ https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts Internet Explorer, get a plug in (Exercise) www.dessci.com/en/products/mathplayer/ www.dessci.com/en/products/mathplayer/ www.dessci.com/en/products/mathplayer/
9
4/17/2015Comp Sci 3469
10
4/17/2015Comp Sci 34610 Plug-in Mathplayer for IE
11
4/17/2015Comp Sci 34611
12
4/17/2015Comp Sci 34612 How to render an XML Document? Extensible Stylesheet Language (XSL) Specify how programs should render XML document data XSL-FO (XSL Formatted Objects) XSL-FO (XSL Formatted Objects) Vocabulary for specifying formattingVocabulary for specifying formatting XSLT (XSL Transformation) XSLT (XSL Transformation) Defines rules for transforming one XML documment to anotherDefines rules for transforming one XML documment to another From Source tree to Result treeFrom Source tree to Result tree Xpath Xpath Locate parts of the source tree document that match templates defined in the XSL stylesheetLocate parts of the source tree document that match templates defined in the XSL stylesheet
13
4/17/2015Comp Sci 34613 Cricket Popular in Commonwealth nations. Processing Instruction (PI) references the XSL stylesheet games.xsl Specifies location of XSLT delimits a PI target
14
4/17/2015Comp Sci 34614 Baseball Popular in America. Soccer (Football) Popular sport in the world. Games.xml continued
15
4/17/2015Comp Sci 34615 XSL style sheet <xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"> <xsl:output method = "html" omit-xml-declaration = "no" doctype-system = "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"/> Start style sheet Binds namespace xsl to W3C XSLT URI Output as xhtml file. Doctype as xhtml “/” is used to select the root
16
4/17/2015Comp Sci 34616 Extensible Stylesheet Language (XSL)
17
4/17/2015Comp Sci 34617 Rendering games.xml
18
4/17/2015Comp Sci 34618 Using XSLT to Sort and Format Data Compare the source in sorting.xml (chapters are out of order) and the rendering
19
4/17/2015Comp Sci 34619
20
4/17/2015Comp Sci 34620 Other applications using XML DOM PHP
21
4/17/2015Comp Sci 34621 DOM Document Object Model Syntax tree for XML document Tree is passed to application (e.g.browser) Application can modify the document via the tree Browser-independent JavaScript functionality
22
4/17/2015Comp Sci 34622 Use XML with PHP XML functionality is based on libxml2 library Enabled by default on Windows and Linux/Unix Enabled by default on Windows and Linux/Unix Check for the following with phpinfo() dom dom libxml libxml simplexml simplexml
23
4/17/2015Comp Sci 34623 Parsing XML with PHP Example 1: Load an xml file into the XML parser and dump the contents Use 25-2xmlload.php to load 25- 1messages.xml as an object Use 25-2xmlload.php to load 25- 1messages.xml as an object Dump the contents of the object Dump the contents of the object
24
4/17/2015Comp Sci 34624 Parsing XML with PHP Example 2: Load an xml file into the XML parser and display the contents Load 25-3 books.xml into XML parser 25- 4xmlparse.php Load 25-3 books.xml into XML parser 25- 4xmlparse.php Break up the elements Break up the elements and display the contents and display the contents Reference on objects in PHP http://us2.php.net/manual/en/language.oop5.php#op5.intro
25
4/17/2015Comp Sci 34625 Parsing XML with PHP Example 3: Rewrite example 1 to load an xml file into the XML parser and display the contents Use 25-4xmlload1.php to load 25- 1messages.xml as an object Use 25-4xmlload1.php to load 25- 1messages.xml as an object Display the contents of the object Display the contents of the object What are the changes?
26
4/17/2015Comp Sci 34626 Summary Conclusions? Description of data Description of data Method of data exchange Method of data exchange Well structured files Well structured files
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.