Browse By

What is Xpath? Examples of Xpath?

What is Xpath? Examples of Xpath?

Before we know Xpath, lets know what XML is?

What is XML?

XML abbreviation is Extensible Markup Language is a markup language similar to HTML which is designed to create information formats and share both the format and the data on the WWW (World Wide Web). It was created to provide an easy to use and store self describing data and it is self-descriptive. XML consists of text and tags which allows content to be separate from style. The tags provide rules that structure the document. XML can be read and understood by XML Parser.

  • XML Element names are case sensitive
  • XML document should have one root element
  • Elements should not overlap
  • Root Element can be called as Parent Element

Example of XML document:

uccollabing.com

uccollabing.com

  • <?xml version=”1.0″ ?> – This indicates the number of version of XML in use.
  • <?xml version=”1.0″ encoding=”ISO-8859-1″?> – This indicates the number of version of XML in use and encoding being used in the document. Types of encoding:
    • ISO-8859-1
    • UTF-8
    • UTF-16
  • XML declaration is optional. If XML is declared, it should be at the top of the document. XML declaration is case sensitive.
  • Each XML element needs to closed. Example of start tag and closed tag:
    • Start Tag     <Post>
    • Closed Tag       </Post>

What is Xpath?

Xpath is a query language that helps in addressing part of XML (Extensible Markup Language ) documents. Xpath is used to search for specific or individual elements or attributes or some parts of an XML document for a matching patterns in the document.
For example :
uccollabing.com

If you would like to just filter all the Title(s) from the entire XML document, you can do it easily with Xpath. The result would look like below:

<Title>SIP Trunk Integration with CUCM and CUC</Title>
<Title>EMCC Configuration</Title>
<Title>CUCM Asterisk SIP Trunk Integration</Title>
<Title>Cisco Unity Connection Java Error</Title>

Xpath can make life little easier.

Next Page – Click here to continue

Hope this helps!

Published by Team UC Collabing

Leave a Reply

Your email address will not be published. Required fields are marked *

Approved
Claudio Quiroz Cabello

Electrical Engineer CCNA Collaboration CCNA Voice CCNA R&S. I'm Electrical Engineer and I work like Support Engineer for a Telephony Service Provider Company. Before that I had position like Pre-Sale Engineer about small and medium multivendor telephony solutions. I have 5 years of experience working in Telephony Multivendor Projects. I am also 3 years of experience working in Support and implementation about Cisco Collaboration platforms: UCS server, UCM, Cisco Unity, Presence Server, Jabber, Gateway. Support Community is most useful in finding design, implementation and support tricks and shortcuts that greatly help me in my daily activities. If you need to contact me, please you can writte me.

Approved
Kanishka Singh

CCNA Routing and Switching
Am a technology enthusiast. I work in network support providing support with implementation, maintaining and precisely troubleshooting the infra.
Realm of collaboration makes me want to learn and face new challenges more and more.

Show Buttons
Hide Buttons