Original: Interpretation of ASP. 5 MVC6 Series (3): Project Release and deploymentIn this chapter we will talk about the ASP.NET5 Project release deployment, which is an example of the bookstore project created in our previous chapter.Pre-release settingsSince the new ASP.NET5 supports the release and deployment of multiple versions of the DNX runtime environment, we need to set the target DNX of the deployment (that is, the previous kre) before depl
absolute path, such as Step/step, which is not using the "/" first.# "." Represents the current node.# ".." Represents the parent node of the current node two, the basic rules of the selection node
-NodeName (node name): Indicates that all child nodes of the node are selected-"/": means to select the root node-"//": Indicates that a node is selected anywhere-"@": indicates that a property is selected
Third, select the instance of the node
Look at an XML instance document first.
[Example 1]
using XPath to find the need to introduce Jaxen-xx-xx.jar, otherwise it will report java.lang.noclassdeffounderror:org/jaxen/jaxenexception exception.
List list=document. selectnodes ("/books/book/@show"); XPath Syntax 1, select the node
XPath uses a path expression to select a node in an XML document, and the node is selected along the path or step.
Common Path Expressions:
An expression
Description
NodeName
Select all child nodes of the current node
Tags: package store www based on ref find Lang ASP wildcardDirectory
1. Installing Xpath
2, XPath basic use
3. XPath syntax
3.1. Commonly used path expressions
3.2. Finding specific elements based on predicates
3.3. Wildcard characters
3.4. Select multiple paths
1. Installing Xpathpip install lxml2, XPath basic usefrom lxml import etree
html = ‘‘‘
3. XPath syntax 3.1, commonly used path expressions
An expression
Desc
the current node.
@
Select the attribute.
InstanceIn the table below, we have listed some path expressions and the results of the expressions:
Path Expression
Results
Bookstore
Selects all child nodes of the bookstore element.
/bookstore
Select the root element bookstore.
current node.# ".." Represents the parent node of the current nodeIi. basic rules for selecting nodes-NodeName (node name): Indicates that all child nodes of the node are selected-"/": Indicates select root node-"//": Indicates that a node is selected anywhere-"@": Indicates the selection of a propertyIii. examples of selecting nodesLet's look at an XML instance document:XML version= "1.0" encoding= "Iso-8859-1"?>Bookstore> Book> titleLang= "Eng
, namespace, processing instruction, comment, and document node (or root node). The root node of the document is the document node, the corresponding attribute has the attribute node, and the element has the element node.
ii. Common path expressionsDescription of expression
NodeName Select all child nodes of this node
/Select from root node
Select the nodes in the document from the current node of the matching selection, regardless of their location
. Select the current node
.. Select the pare
compatriots.Ancestors (ancestor)In Example 1, the ancestor of the title element is the book element and the bookstore element.Descendants (descendant)In Example 1, the descendants of the bookstore element are the book, title, author, year, and price elements.XPath uses a path expression to pick a node or set of nodes in an XML document. A node is picked up either along a path or a step (steps).XML Instance
document (Root) nodes. XML documents are treated as node trees. The root of a tree is called a document node or a root node.
See the following XML document:
Node example in the XML document above:
Lang = "en" (attribute node)
Basic value (or Atomic value)
The basic value is a node with no parent or child.
Example of the basic value:
Beijing
"Chinese"
Item)
A project is a basic value or node.
Node relationship
Parent)
Each element and attribute has a parent.
In the fo
using XPath to find the need to introduce Jaxen-xx-xx.jar, otherwise it will report java.lang.noclassdeffounderror:org/jaxen/jaxenexception exception. List list=document. selectnodes ("/books/book/@show");XPath syntax 1, selecting nodesXPath uses a path expression to select a node in an XML document, and the node is selected along a path or step.Common Path Expressions:
An expression
Describe
NodeName
Selects all child nodes of the current node
the nodes in the document from the current node of the matching selection, regardless of their location
.
Select the current node
..
Select the parent node of the current node
@
Select Properties
wildcard characters
Describe
*
Match any element node
@*
Match any attribute node
Node ()
Match any type of node
|
Select several paths
Iv. examples
D
expressions and expression results:
Path expression
Result
Bookstore
Select All subnodes of the bookstore Element
/Bookstore
Select the root element bookstore Note: If the path starts with a forward slash (/), the path always represents the absolute path t
selected node, regardless of their location.
.
Select the current node.
..
Select the parent node of the current node.
@
Select attributes.
Instance
In the following table, we have listed some path expressions and expression results:
Path expression
Result
Bookstore
Select All subnodes of the bookstore element.
/
Xmldocument xmldoc = new xmldocument ();
Xmldoc. Load ("Bookstore. xml ");
// Xmldoc. loadxml ("
Xmlnode root = xmldoc. selectsinglenode ("Bookstore"); // query
Xmlelement xe1 = xmldoc. createelement ("book"); // create a
Xe1.setattribute ("genre", "lizan red"); // you can specify the genre attribute of the node.
Xe1.setattribute ("ISBN", "2-3631-4"); // you can specify the ISBN attribute of the nod
Get document
Saxreader = new saxreader ();
Document document = saxreader. Read (fileutil. getfileinputstream (filename ));
Query Element
String XPath = "/Composites/composite [@ type = 'ondelete']"; // query the composite of the attribute type = 'ondelete'
List
XPath syntax
Select Node
XPath uses path expressions to select nodes in XML documents. Nodes are selected by following the path or step.The most useful path expressions are listed below:
Expression
D
Select a node
expression
description
nodename
Select all child nodes of this node.
/
from the root node Select.
//
from matching Select the current node to select the nodes in the document, regardless of their location.
Select the current node.
:
Select the parent node of the current node.
@
select Properties 。
ArticleDirectory
The most useful path expressions are listed below:
Instance
Instance
Instance
Instance
XPath uses path expressions to select nodes or node sets in XML documents. Nodes are selected by following the path or step (steps. XML instance document
We will use this XML document in the following example.
Select Node
XPath uses path expressions to select nodes in XML documents. Nodes are selected by following the path or step. The most useful path expressi
Interpretation of ASP. NET 5 MVC6 series (3): Project release and deployment, and interpretation of ASP. NET
This chapter describes ASP. NET5 project release and deployment. The example project uses the BookStore project created in the previous chapter as an example.
Pre-release settings
The new ASP. NET5 version supports the release and deployment of multiple DNX runtime environments. Therefore, before deployment, we need to set the target DNX (the
.
InstanceIn the table below, we have listed some path expressions and the results of the expressions:
Path Expression
Results
Bookstore
Selects all child nodes of the bookstore element.
/bookstore
Select the root element bookstore.Note: If the path starts with a forward slash (/), this path
XPath is a language used to search for information in XML documents. XPath is used to navigate through elements and attributes in XML documents.
(My understanding: XPath is a path language used to find XML nodes, and a path string syntax)XML instance document
We will use this XML document in the following example.
Select Node
XPath uses path expressions to select nodes in XML documents. Nodes are selected by following the path or step. The most useful path expressions are listed below:
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.