SlideShare a Scribd company logo
XPath - XML Path Language  XML http://yht4ever.blogspot.com [email_address] B070066 - NIIT Quang Trung 08/2007
Contents Exercises Node-set Operators and Functions Location Paths Nodes Introduction
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Nodes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Simple XML document  1 <?xml version =  &quot;1.0&quot; ?> 2 3 <!-- simple.xml --> 4 <!-- Simple XML document  --> 5 6 <book title =  “C++ How to Program&quot;   edition =  &quot;3&quot; > 7 8   <sample> 9   <![CDATA[ 10   11   // C++ comment 12   if ( this->getX() < 5 && value[ 0 ] != 3 ) 13   cerr << this->displayError(); 14   ]]> 15   </sample> 16   17   C++ How to Program by Deitel &amp; Deitel 18 </book> Root node Comment nodes Attribute nodes Element nodes Text nodes
XPath tree for simple.xml Attribute Title C++ How to Program Element book Comment Fig. 11.1 : simple.xml Comment Simple XML document Attribute edition 3 Root Text C++ How to Program by Deitel & Deitel Element sample Text // C++ comment  if (this -> getX() < 5 && value[ 0 ] != 3 )    cerr << this->displayError();
XML document with processing-instruction and namespace nodes 1 <?xml version =  &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.3 : simple2.xml  --> 4 <!-- Processing instructions and namespacess  --> 5 6 <html xmlns =  &quot;http://www.w3.org/TR/REC-html40&quot; > 7 8   <head> 9   <title> Processing Instruction and Namespace Nodes </title> 10   </head> 11 12   <?deitelprocessor example =  &quot;fig11_03.xml&quot; ?> 13 14   <body> 15 16   <deitel:book deitel:edition =  &quot;1&quot;   17   xmlns:deitel =  &quot;http://www.deitel.com/xmlhtp1&quot; > 18   <deitel:title> XML How to Program </deitel:title> 19   </deitel:book> 20 21   </body> 22 23 </html> Root node Comment nodes Namespace nodes Processing instruction node Element nodes Text nodes Attribute nodes
Tree diagram of an XML document with a processing-instruction node Continued on next slide ... Root Comment Fig. 11.3 : simple2.xml Comment Processing instructions and namespaces Element html Namespace http://www.w3.org/TR/REC-html40 Element head Text Processing instructions and Namespcae Nodes Element title
Tree diagram of an XML document with a processing-instruction node Continued from previous slide Processing Instruction deitelprocessor example =  &quot; fig11_03.xml &quot; Element body Element book Attribute edition 1 Namespace http://www.deitel.com/xmlhtp1 Element title Text XML How to Program
XPath node types
XPath node types (cont.)
Location Paths ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Axes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XPath axes
Node Tests ,[object Object],[object Object],[object Object],[object Object]
Some XPath node tests
Location Paths Using Axes and Node Tests ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some location-path abbreviations
Node-set Operators and Functions ,[object Object],[object Object],[object Object],[object Object]
Node-set operators
Some node-set functions
Node-set Operators and Functions (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
1 <?xml version =  &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.13 : stocks.xml --> 4 <!-- Stock list  --> 5 6 <stocks> 7 8   <stock symbol =  &quot;INTC&quot; > 9   <name> Intel Corporation </name> 10   </stock> 11 12   <stock symbol =  &quot;CSCO&quot; > 13   <name> Cisco Systems, Inc. </name> 14   </stock> 15 16   <stock symbol =  &quot;DELL&quot; > 17   <name> Dell Computer Corporation </name> 18   </stock> 19 20   <stock symbol =  &quot;MSFT&quot; > 21   <name> Microsoft Corporation </name> 22   </stock> 23 24   <stock symbol =  &quot;SUNW&quot; > 25   <name> Sun Microsystems, Inc. </name> 26   </stock> 27 28   <stock symbol =   &quot;CMGI&quot; > 29   <name> CMGI, Inc. </name> 30   </stock> 31 32 </stocks>
1 <?xml version =  &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.14 : stocks.xsl --> 4 <!-- string function usage  --> 5 6 <xsl:stylesheet version =  &quot;1.0&quot; 7   xmlns:xsl =  &quot;http://www.w3.org/1999/XSL/Transform&quot; > 8 9   <xsl:template match =  &quot;/stocks&quot; > 10   <html> 11   <body> 12   <ul> 13 14   <xsl:for-each select =  &quot;stock&quot; > 15 16   <xsl:if test =  17   &quot;starts-with(@symbol, 'C')&quot; > 18 19   <li> 20   <xsl:value-of select =  21   &quot;concat(@symbol,' - ', name)&quot; /> 22   </li> 23   </xsl:if> 24 25   </xsl:for-each> 26   </ul> 27   </body> 28   </html> 29   </xsl:template> 30 </xsl:stylesheet> XPath string functions
Reference ,[object Object],[object Object],[object Object]
Q&A ,[object Object],[object Object]
http://yht4ever.blogspot.com Thank You !

More Related Content

What's hot (20)

Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
React/Redux
React/ReduxReact/Redux
React/Redux
 
Nuxtjs cheat-sheet
Nuxtjs cheat-sheetNuxtjs cheat-sheet
Nuxtjs cheat-sheet
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
React Hooks
React HooksReact Hooks
React Hooks
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Document object model
Document object modelDocument object model
Document object model
 
React js
React jsReact js
React js
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to Hooks
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART I
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
ReactJS
ReactJSReactJS
ReactJS
 
React Context API
React Context APIReact Context API
React Context API
 
Javascript
JavascriptJavascript
Javascript
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
Xpath
XpathXpath
Xpath
 

Viewers also liked (20)

Xpath presentation
Xpath presentationXpath presentation
Xpath presentation
 
XML
XMLXML
XML
 
XMPP - Introduction And LAS Implementation (Presentation)
XMPP - Introduction And LAS  Implementation (Presentation)XMPP - Introduction And LAS  Implementation (Presentation)
XMPP - Introduction And LAS Implementation (Presentation)
 
Introduction
IntroductionIntroduction
Introduction
 
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easyIEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
IEEE 2014 JAVA DATA MINING PROJECTS Xs path navigation on xml schemas made easy
 
eXtensible Markup Language
eXtensible Markup LanguageeXtensible Markup Language
eXtensible Markup Language
 
Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy Xs path navigation on xml schemas made easy
Xs path navigation on xml schemas made easy
 
XML and XPath details
XML and XPath detailsXML and XPath details
XML and XPath details
 
Introduction to XPath
Introduction to XPathIntroduction to XPath
Introduction to XPath
 
Understanding XML DOM
Understanding XML DOMUnderstanding XML DOM
Understanding XML DOM
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
XSLT
XSLTXSLT
XSLT
 
Overview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FOOverview of XSL, XPath and XSL-FO
Overview of XSL, XPath and XSL-FO
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Xml dom
Xml domXml dom
Xml dom
 
Web Scraping for Code-ophobes
Web Scraping for Code-ophobesWeb Scraping for Code-ophobes
Web Scraping for Code-ophobes
 
XSLT
XSLTXSLT
XSLT
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
XPATH
XPATHXPATH
XPATH
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 

Similar to XPath - XML Path Language

Similar to XPath - XML Path Language (20)

Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
6 311 W
6 311 W6 311 W
6 311 W
 
6 311 W
6 311 W6 311 W
6 311 W
 
test
testtest
test
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
 
Struts2
Struts2Struts2
Struts2
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18
 
Xml
XmlXml
Xml
 
Relax NG, a Schema Language for XML
Relax NG, a Schema Language for XMLRelax NG, a Schema Language for XML
Relax NG, a Schema Language for XML
 
Lotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXLLotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXL
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
 
Xml and Co.
Xml and Co.Xml and Co.
Xml and Co.
 
Wso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1stWso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1st
 
AdvancedXPath
AdvancedXPathAdvancedXPath
AdvancedXPath
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
Unit 5 xml (1)
Unit 5   xml (1)Unit 5   xml (1)
Unit 5 xml (1)
 
Xml session
Xml sessionXml session
Xml session
 

More from yht4ever

Applications of SOA and Web Services in Grid Computing
Applications of SOA and Web Services in Grid ComputingApplications of SOA and Web Services in Grid Computing
Applications of SOA and Web Services in Grid Computingyht4ever
 
ERD - Database Design
ERD - Database DesignERD - Database Design
ERD - Database Designyht4ever
 
Web Page Authoring 1
Web Page Authoring 1Web Page Authoring 1
Web Page Authoring 1yht4ever
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLyht4ever
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLyht4ever
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelyht4ever
 
Rendering XML Document
Rendering XML DocumentRendering XML Document
Rendering XML Documentyht4ever
 
Rendering XML Documents
Rendering XML DocumentsRendering XML Documents
Rendering XML Documentsyht4ever
 
XML Schema
XML SchemaXML Schema
XML Schemayht4ever
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definitionyht4ever
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLyht4ever
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 

More from yht4ever (12)

Applications of SOA and Web Services in Grid Computing
Applications of SOA and Web Services in Grid ComputingApplications of SOA and Web Services in Grid Computing
Applications of SOA and Web Services in Grid Computing
 
ERD - Database Design
ERD - Database DesignERD - Database Design
ERD - Database Design
 
Web Page Authoring 1
Web Page Authoring 1Web Page Authoring 1
Web Page Authoring 1
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Rendering XML Document
Rendering XML DocumentRendering XML Document
Rendering XML Document
 
Rendering XML Documents
Rendering XML DocumentsRendering XML Documents
Rendering XML Documents
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Document Type Definition
Document Type DefinitionDocument Type Definition
Document Type Definition
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 

Recently uploaded

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»QADay
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 

Recently uploaded (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

XPath - XML Path Language

  • 1. XPath - XML Path Language XML http://yht4ever.blogspot.com [email_address] B070066 - NIIT Quang Trung 08/2007
  • 2. Contents Exercises Node-set Operators and Functions Location Paths Nodes Introduction
  • 3.
  • 4.
  • 5. Simple XML document 1 <?xml version = &quot;1.0&quot; ?> 2 3 <!-- simple.xml --> 4 <!-- Simple XML document --> 5 6 <book title = “C++ How to Program&quot; edition = &quot;3&quot; > 7 8 <sample> 9 <![CDATA[ 10 11 // C++ comment 12 if ( this->getX() < 5 && value[ 0 ] != 3 ) 13 cerr << this->displayError(); 14 ]]> 15 </sample> 16 17 C++ How to Program by Deitel &amp; Deitel 18 </book> Root node Comment nodes Attribute nodes Element nodes Text nodes
  • 6. XPath tree for simple.xml Attribute Title C++ How to Program Element book Comment Fig. 11.1 : simple.xml Comment Simple XML document Attribute edition 3 Root Text C++ How to Program by Deitel & Deitel Element sample Text // C++ comment if (this -> getX() < 5 && value[ 0 ] != 3 ) cerr << this->displayError();
  • 7. XML document with processing-instruction and namespace nodes 1 <?xml version = &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.3 : simple2.xml --> 4 <!-- Processing instructions and namespacess --> 5 6 <html xmlns = &quot;http://www.w3.org/TR/REC-html40&quot; > 7 8 <head> 9 <title> Processing Instruction and Namespace Nodes </title> 10 </head> 11 12 <?deitelprocessor example = &quot;fig11_03.xml&quot; ?> 13 14 <body> 15 16 <deitel:book deitel:edition = &quot;1&quot; 17 xmlns:deitel = &quot;http://www.deitel.com/xmlhtp1&quot; > 18 <deitel:title> XML How to Program </deitel:title> 19 </deitel:book> 20 21 </body> 22 23 </html> Root node Comment nodes Namespace nodes Processing instruction node Element nodes Text nodes Attribute nodes
  • 8. Tree diagram of an XML document with a processing-instruction node Continued on next slide ... Root Comment Fig. 11.3 : simple2.xml Comment Processing instructions and namespaces Element html Namespace http://www.w3.org/TR/REC-html40 Element head Text Processing instructions and Namespcae Nodes Element title
  • 9. Tree diagram of an XML document with a processing-instruction node Continued from previous slide Processing Instruction deitelprocessor example = &quot; fig11_03.xml &quot; Element body Element book Attribute edition 1 Namespace http://www.deitel.com/xmlhtp1 Element title Text XML How to Program
  • 11. XPath node types (cont.)
  • 12.
  • 13.
  • 15.
  • 17.
  • 19.
  • 22.
  • 23. 1 <?xml version = &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.13 : stocks.xml --> 4 <!-- Stock list --> 5 6 <stocks> 7 8 <stock symbol = &quot;INTC&quot; > 9 <name> Intel Corporation </name> 10 </stock> 11 12 <stock symbol = &quot;CSCO&quot; > 13 <name> Cisco Systems, Inc. </name> 14 </stock> 15 16 <stock symbol = &quot;DELL&quot; > 17 <name> Dell Computer Corporation </name> 18 </stock> 19 20 <stock symbol = &quot;MSFT&quot; > 21 <name> Microsoft Corporation </name> 22 </stock> 23 24 <stock symbol = &quot;SUNW&quot; > 25 <name> Sun Microsystems, Inc. </name> 26 </stock> 27 28 <stock symbol = &quot;CMGI&quot; > 29 <name> CMGI, Inc. </name> 30 </stock> 31 32 </stocks>
  • 24. 1 <?xml version = &quot;1.0&quot; ?> 2 3 <!-- Fig. 11.14 : stocks.xsl --> 4 <!-- string function usage --> 5 6 <xsl:stylesheet version = &quot;1.0&quot; 7 xmlns:xsl = &quot;http://www.w3.org/1999/XSL/Transform&quot; > 8 9 <xsl:template match = &quot;/stocks&quot; > 10 <html> 11 <body> 12 <ul> 13 14 <xsl:for-each select = &quot;stock&quot; > 15 16 <xsl:if test = 17 &quot;starts-with(@symbol, 'C')&quot; > 18 19 <li> 20 <xsl:value-of select = 21 &quot;concat(@symbol,' - ', name)&quot; /> 22 </li> 23 </xsl:if> 24 25 </xsl:for-each> 26 </ul> 27 </body> 28 </html> 29 </xsl:template> 30 </xsl:stylesheet> XPath string functions
  • 25.
  • 26.