XML data in MySQL supports bitsCN.com.
Today, I want to introduce you to XPath, which is the language for navigation and querying XML documents. We start with a function.
UpdateXML () function
We have spent a lot of time introducing the ExtractValue () function, but have not introduced other XML functions of MySQL, su
/name[text () = ' Zhang Qi ']")C. Return department name node with staff 22345Objnode = Objdoc.selectsinglenode ("company/department[employees/employee/@id = ' 22345 ']/department_name")2.7 Querying multiple-mode nodesUse | The symbol can get multiple patterns of nodes. For example:objNodeList = Objdoc.selectnodes ("company/department/department_name | Company/department/manager ")2.8 Querying any child nodesUse the * symbol to return all child nodes of the current node.objNodeList = Objdoc.sele
It was repeatedly asked why, in the DBA's specification, it would be necessary to add the text () function to the XPath of the value method when parsing the XML value, and it would seem that the addition and no results were the same.
The following test script illustrates the difference between using text () and why it is required.
DECLARE@xml
The XPath data mode depends on the XPathNavigator class stored in the System. Xml. XPath namespace.
The XPathNavigator class is an abstract class. It is a pointer-based XML data browsing mode that allows you to edit XML files.
You can obtain an instance of the XPathNavigat
Xml
These two days are programmed for an RSS interface provided by another company, because they provide 1.0 version of RSS, where the XML part of the namespace, for this day and night for this, fell a lot of tumbling, Unicode coding problems, XPath problems, XSLT parsing problems. The following is a list of the solutions to these problems for the convenience of
The hypothetical xml file contains the following content ..
How to retrieve the internal or external content at a specific xml vertex... there is a simple example below... using xpath...
Part of asp.net (c #) Programs
Using System;Using System. Collections;Using System. Configuration;Using System. Data;Using System. Web;Using System. Web. Security;Using Syste
Today, with the help of the instance for configuring Oracle database connection, we will learn one way to read xml files (other reading methods will be introduced later): mdash; dom4j
Today, with the help of the instance for configuring Oracle database connection, we will learn one way to read xml files (other reading methods will be introduced later): mdash; dom4j
Today, with the help of the instance
XPath is the content of XML, where SelectNodes is a method of XmlDocument or XmlNode in C #. SelectNodes uses XPath to select nodes.Important syntaxSelectNodes ("item") Select the node named item from the son node of the current node. SelectNodes ("/item") Select the node named item from the son node of the root node. SelectNodes ("//item")Select the node named i
The code is as follows:
/*
*/
if (!function_exists (' l ')) {
function L () {
echo ' }
}
if (file_exists (' Test10_12.xml ')) {
$xml = simplexml_load_file (' Test10_12.xml ');
Finding node locations using the XPath method
$query = $xml->
The core idea of XPath design can be quickly introduced by xpath to locate the desired node. The main purpose is to describe the location of a node relative to another node. All qualified nodes can be obtained and become [location paths]. Xapth is mainly used to query information in XML documents. You can use path expressions to parse
I have been asked many times why the DBA specification requires that the text () function be added to the XPath of the value method when parsing XML values, it seems that the result of adding and not adding is the same.
The following test script shows the difference between text () and why it is required.
Declare@ XML XML
Everyday Italian Giada De Laurentiis 2005 30.00 Harry Potter J K. Rowling 2005 29.99 XQuery Kick Start James McGovern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49.99 Learning XML Erik T. Ray 2003 39.95
The above is the BookStore. xml file
Start processing
XDocument xdoc = XDocument.Load(); X
Document directory
Processing node Nodes functions
Returns a Boolean function.
Function for processing string Strings
Function for processing numeric Numbers
Location path: path, which is equivalent to the path of a file in the file system. XML documents contain many elements and attributes. The Location of nodes, elements, and attributes specified according to the XPath syntax rules in the
Today, with the help of the instance for configuring Oracle database connection, we will learn one way to read xml files (other reading methods will be introduced later)-using dom4j + xpath.
Dom4j is an open-source XML parsing package produced by dom4j.org. Therefore, the package "dom4j-1.6.1.jar" must be copied to the web-inf/lib.
We take the
Use an xpath expression to query the
28
23
22
Based on the requirements of the question, how can I write the xls document? Please kindly advise
------ Solution --------------------
$ S =
28
23
22
Copy codeThe Code is as follows:/**/If (! Function_exists ('l ')){Function l (){Echo '}}If (file_exists ('test10 _ 12. xml ')){$ Xml = simplexml_load_file ('test10 _ 12. xml ');// Use the xpath method to find the node location$ Query = $ xml->
Copy codeThe Code is as follows: /*
*/
If (! Function_exists ('l ')){
Function l (){
Echo '}
}
If (file_exists ('test10 _ 12. xml ')){
$ Xml = simplexml_load_file ('test10 _ 12. xml ');
// Use the xpath method to find the node location$ Query = $ xml->
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.