SlideShare a Scribd company logo
P   P   L
D:Web TechnologiesXml
/


                              predicate

                      node test
               axis

/child::Contacts/child::Contact[@id=3]/child::phone
• child axis               • following-sibling axis
• attribute axis           • namespace axis
• ancestor axis            • parent axis
• ancestor-or-self axis    • preceding axis
• descendant axis          • preceding-sibling axis
• descedant-or-self axis   • self axis
• following axis
ancestor-or-self

                             ancestor
      preceding                                   following


                               parent

preceding-sibling                                   following-sibling


                              self




                               child



                      descendant
                    descendant-or-seft
• //Contact[@id=3]
• //Contact[@title=“Mr”][@age>25]
• Boolean boolean(arg)       //returns false if object equal to zero/NaN/empty
• Boolean false()            //returns the Boolean value false
• Boolean lang(string arg)   //to check language which is used in context node
• Boolean not(arg)           //
• Boolean true()             // returns the Boolean value true
• number count(node-set arg)                   //returns the number of nodes
• node-set id(string arg)                     //returns a node-set
• last()                                      // returns a value equal to the context size
• string local-name(optional node-set arg)    //returns local name(context node)
• string name(optional node-set arg)          //returns the nam of node in QName format
• string namespace-uri(optional node-set arg) //returns namespace-uri of node-set
• Number position()                           //returns value equal to the context position
• number ceiling( number arg)   //returns the smallest integer greater than this
• number floor(number arg)      //returns the largest integer that is lower than this
• number number(arg)            //to convert string, Boolean, node-set to number
                                //returns NaN if can not convert
• number round(number arg)      //returns the integer that is closest to the number arg
• number sum(node-set arg)      // return sum of node in node-set
                                // return NaN if node can’t converted to number
• string concat(string arg1, arg2)            //returns the concatenation of those strings
• Boolean contains(string arg1, arg2)         //returns true if arg1 contains arg2
• string normalize-space(string arg1)          //=trim & replace whitespace=single space
• Boolean start-with(string arg1, arg2)       //returns true if arg1 starts with arg2
• string string(arg)                          //to convert Boolean, node-set, number to string
• number string-length(string arg)         //returns the length of the string arg
• string substring(string arg1, number arg2, optional number arg3)          //return substring of arg1
• string substring-before(string arg1, arg2)         //
• string substring-after(string arg1, arg2)          //
• string translate(string arg1, arg2, arg 3)         //
 Functions and location paths are orthogonal
• /child::Contacts/child::Contact[@id=3]/child::phone
• /Contacts/Contact[@id=3]/phone
http://www.w3.org/TR/xpath20/
http://www.w3.org/TR/xpath-functions/
http://www.w3.org/TR/xpath-datamodel/
XPath

More Related Content

Similar to XPath

Introduction to Regular Expressions RootsTech 2013
Introduction to Regular Expressions RootsTech 2013Introduction to Regular Expressions RootsTech 2013
Introduction to Regular Expressions RootsTech 2013
Ben Brumfield
 

Similar to XPath (14)

Introduction to Regular Expressions RootsTech 2013
Introduction to Regular Expressions RootsTech 2013Introduction to Regular Expressions RootsTech 2013
Introduction to Regular Expressions RootsTech 2013
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Bioinformatica p2-p3-introduction
Bioinformatica p2-p3-introductionBioinformatica p2-p3-introduction
Bioinformatica p2-p3-introduction
 
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekingeBioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
Bioinformatics p2-p3-perl-regexes v2013-wim_vancriekinge
 
Intro to Perl and Bioperl
Intro to Perl and BioperlIntro to Perl and Bioperl
Intro to Perl and Bioperl
 
Javascript
JavascriptJavascript
Javascript
 
perl-pocket
perl-pocketperl-pocket
perl-pocket
 
perl-pocket
perl-pocketperl-pocket
perl-pocket
 
perl-pocket
perl-pocketperl-pocket
perl-pocket
 
perl-pocket
perl-pocketperl-pocket
perl-pocket
 
Basic perl programming
Basic perl programmingBasic perl programming
Basic perl programming
 
Petitparser at the Deep into Smalltalk School 2011
Petitparser at the Deep into Smalltalk School 2011Petitparser at the Deep into Smalltalk School 2011
Petitparser at the Deep into Smalltalk School 2011
 
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
Bioinformatica: Esercizi su Perl, espressioni regolari e altre amenità (BMR G...
 
Quick swift tour
Quick swift tourQuick swift tour
Quick swift tour
 

More from Hoang Nguyen

SOME SECURITY CHALLENGES IN CLOUD COMPUTING
SOME SECURITY CHALLENGES  IN CLOUD COMPUTINGSOME SECURITY CHALLENGES  IN CLOUD COMPUTING
SOME SECURITY CHALLENGES IN CLOUD COMPUTING
Hoang Nguyen
 
Multiple processor systems
Multiple processor systemsMultiple processor systems
Multiple processor systems
Hoang Nguyen
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
Hoang Nguyen
 

More from Hoang Nguyen (20)

GANs and Applications
GANs and ApplicationsGANs and Applications
GANs and Applications
 
Scrum - An introduction
Scrum - An introductionScrum - An introduction
Scrum - An introduction
 
ORM in Django
ORM in DjangoORM in Django
ORM in Django
 
Introduction to Cross-platform App Development
Introduction to Cross-platform App DevelopmentIntroduction to Cross-platform App Development
Introduction to Cross-platform App Development
 
Conistency of random forests
Conistency of random forestsConistency of random forests
Conistency of random forests
 
Trust - Digital Signature
Trust - Digital SignatureTrust - Digital Signature
Trust - Digital Signature
 
Key Exchange
Key ExchangeKey Exchange
Key Exchange
 
SOME SECURITY CHALLENGES IN CLOUD COMPUTING
SOME SECURITY CHALLENGES  IN CLOUD COMPUTINGSOME SECURITY CHALLENGES  IN CLOUD COMPUTING
SOME SECURITY CHALLENGES IN CLOUD COMPUTING
 
Stream ciphers
Stream ciphersStream ciphers
Stream ciphers
 
Classical ciphers
Classical ciphersClassical ciphers
Classical ciphers
 
Confidentiality
ConfidentialityConfidentiality
Confidentiality
 
Information, Data and Decision Making
Information, Data and Decision MakingInformation, Data and Decision Making
Information, Data and Decision Making
 
Multiple processor systems
Multiple processor systemsMultiple processor systems
Multiple processor systems
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
 
Introduction to AOS course
Introduction to AOS courseIntroduction to AOS course
Introduction to AOS course
 
Background Knowledge
Background KnowledgeBackground Knowledge
Background Knowledge
 
Introduction to Information Security Course
Introduction to Information Security CourseIntroduction to Information Security Course
Introduction to Information Security Course
 
Introduction to CNS Course
Introduction to CNS CourseIntroduction to CNS Course
Introduction to CNS Course
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Nosql intro
Nosql introNosql intro
Nosql intro
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

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)
 
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...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
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
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
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 ...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
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...
 
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
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
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

  • 1.
  • 2.
  • 3.
  • 4. P P L
  • 6.
  • 7. / predicate node test axis /child::Contacts/child::Contact[@id=3]/child::phone
  • 8. • child axis • following-sibling axis • attribute axis • namespace axis • ancestor axis • parent axis • ancestor-or-self axis • preceding axis • descendant axis • preceding-sibling axis • descedant-or-self axis • self axis • following axis
  • 9. ancestor-or-self ancestor preceding following parent preceding-sibling following-sibling self child descendant descendant-or-seft
  • 11. • Boolean boolean(arg) //returns false if object equal to zero/NaN/empty • Boolean false() //returns the Boolean value false • Boolean lang(string arg) //to check language which is used in context node • Boolean not(arg) // • Boolean true() // returns the Boolean value true
  • 12. • number count(node-set arg) //returns the number of nodes • node-set id(string arg) //returns a node-set • last() // returns a value equal to the context size • string local-name(optional node-set arg) //returns local name(context node) • string name(optional node-set arg) //returns the nam of node in QName format • string namespace-uri(optional node-set arg) //returns namespace-uri of node-set • Number position() //returns value equal to the context position
  • 13. • number ceiling( number arg) //returns the smallest integer greater than this • number floor(number arg) //returns the largest integer that is lower than this • number number(arg) //to convert string, Boolean, node-set to number //returns NaN if can not convert • number round(number arg) //returns the integer that is closest to the number arg • number sum(node-set arg) // return sum of node in node-set // return NaN if node can’t converted to number
  • 14. • string concat(string arg1, arg2) //returns the concatenation of those strings • Boolean contains(string arg1, arg2) //returns true if arg1 contains arg2 • string normalize-space(string arg1) //=trim & replace whitespace=single space • Boolean start-with(string arg1, arg2) //returns true if arg1 starts with arg2 • string string(arg) //to convert Boolean, node-set, number to string • number string-length(string arg) //returns the length of the string arg • string substring(string arg1, number arg2, optional number arg3) //return substring of arg1 • string substring-before(string arg1, arg2) // • string substring-after(string arg1, arg2) // • string translate(string arg1, arg2, arg 3) //
  • 15.  Functions and location paths are orthogonal