Hướng dẫn XML

TRANG CHỦ XML Giới thiệu XML Cách sử dụng XML Cây XML Cú pháp XML Phần tử XML Thuộc tính XML Không gian tên XML Hiển thị XML HttpRequest XML Trình phân tích cú pháp XML DOM XML XPath XML XSLT XML XQuery XML XML XLink Trình xác thực XML DTD XML Lược đồ XML Máy chủ XML Ví dụ về XML Câu đố XML Chứng chỉ XML

XML AJAX

Giới thiệu AJAX AJAX XMLHttp Yêu cầu AJAX Phản hồi AJAX Tệp XML AJAX AJAX PHP AJAX ASP Cơ sở dữ liệu AJAX Ứng dụng AJAX Ví dụ về AJAX

DOM XML

Giới thiệu DOM Nút DOM Truy cập DOM Thông tin nút DOM Danh sách nút DOM DOM Traversing Điều hướng DOM DOM Nhận giá trị Nút thay đổi DOM DOM Xóa các nút Nút thay thế DOM DOM Tạo nút DOM Thêm nút Nút nhân bản DOM Ví dụ về DOM

Hướng dẫn XPath

Giới thiệu XPath Nút XPath Cú pháp XPath Trục XPath Toán tử XPath Ví dụ về XPath

Hướng dẫn XSLT

Giới thiệu XSLT Ngôn ngữ XSL Chuyển đổi XSLT XSLT <template> XSLT <value-of> XSLT <for-each> XSLT <sắp xếp> XSLT <if> XSLT <chọn> Áp dụng XSLT XSLT trên máy khách XSLT trên Máy chủ XSLT Chỉnh sửa XML Ví dụ về XSLT

Hướng dẫn XQuery

Giới thiệu XQuery Ví dụ về XQuery XQuery FLWOR HTML XQuery Điều khoản XQuery Cú pháp XQuery XQuery Thêm Chọn XQuery Hàm XQuery

DTD XML

Giới thiệu DTD Khối xây dựng DTD Phần tử DTD Các thuộc tính DTD Phần tử DTD so với Attr Thực thể DTD Ví dụ về DTD

Lược đồ XSD

Giới thiệu XSD XSD Cách thực hiện XSD <schema> Phần tử XSD Thuộc tính XSD Hạn chế XSD

XSD Complex

Phần tử XSD XSD trống Chỉ các phần tử XSD Chỉ văn bản XSD XSD hỗn hợp Chỉ báo XSD XSD <nhiều> XSD <anyAttribute> Thay thế XSD Ví dụ về XSD

Dữ liệu XSD

Chuỗi XSD Ngày XSD XSD Numeric XSD Misc Tham chiếu XSD

Dịch vụ web

XML Services XML WSDL XML SOAP XML RDF XML RSS

References

DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM Parser XSLT Elements XSLT/XPath Functions

XQuery Tutorial


What is XQuery?

XQuery is to XML what SQL is to databases.

XQuery is designed to query XML data.


XQuery Example

for $x in doc("books.xml")/bookstore/book
where $x/price>30
order by $x/title
return $x/title


What is XQuery?

XQuery
  • XQuery is the language for querying XML data
  • XQuery for XML is like SQL for databases
  • XQuery is built on XPath expressions
  • XQuery is supported by all major databases
  • XQuery is a W3C Recommendation

XQuery is About Querying XML

XQuery is a language for finding and extracting elements and attributes from XML documents.

Here is an example of what XQuery could solve:

"Select all CD records with a price less than $10 from the CD collection stored in cd_catalog.xml"


XQuery and XPath

XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators. If you have already studied XPath you will have no problems with understanding XQuery.


XQuery - Examples of Use

XQuery can be used to:

  • Extract information to use in a Web Service
  • Generate summary reports
  • Transform XML data to XHTML
  • Search Web documents for relevant information

XQuery is a W3C Recommendation

XQuery is compatible with several W3C standards, such as XML, Namespaces, XSLT, XPath, and XML Schema.

XQuery 1.0 became a W3C Recommendation in 2007.