- It is used to retrieve both hierarchal and tabular data.
- It is to query both tree and graphical structures.
- It is applied to build web pages.
- It is applied to query web pages.
- It is also used to transform XML documents into XHTML documents.
- It is always best for XML-based databases and object-based databases. Object databases are much more flexible and powerful than purely tabular databases.
Q. What is the syntax rule for XQuery language?
- It has a set of rules that needs to be followed. The first thing is that XQuery is case sensitive.
- It attributes and variables that we used should have valid XML names in XQuery elements.
- You must know that XQuery should be written within single and double quotes.
- It is also good to know that XQuery variables should be defined as $(variable name). For example: $book.
- XQuery comment can be written between colon (:). Like :(: Comment in XQuery:)
Q. What is the major difference between XQuery and XPath?
Ans. A major difference exists between these two. Firstly, XQuery is the functional programming and query language while XPath is XML path language. On the other part, XQuery is used to extract and manipulate data from either XML documents or relational databases while XPath is used to compute values like strings, numbers and Boolean types from another XML documents. This makes the major difference that is found between them.
Q. Which are the main types of problems solved by XQuery?
Ans. XQuery can be used to solve the following queries in XML data:
- XQuery is used to retrieve information in a web service.
- It is used to generate the summary report.
- It is used to transform data from XML to XHTML.
- It can be used when we want some relevant information from Web documents.
Q. What is the filtering process for XQuery?
Ans. There is a process that you need to follow for the filtering process of XQuery. Selecting and filtering refer to query to the database for selecting a group of data and filtering that data for a specific type. For example to select the name of books whose price is less than 30 dollars? XQuery FLWOR and Path expression are used for selecting and filtering the XML elements. Both are used to select and filter the desired elements. So, if you follow this process, you can just get the one you are searching for.