"). childNodes; // Obtain all subnodes of the Employees node foreach (XmlNode xn in nodeList) // traverse all subnodes {XmlElement xe = (XmlElement) xn; // Convert the subnode type to the XmlElement type if (xe. getAttribute ("genre") = "zhang san") // if the genre attribute value is "zhang san" {xe. setAttribute ("genre", "update Zhangsan"); // modify this attr
");
// ==========================Result:
2. Modify the node: Change the genre value of the node whose genre attribute value is "Li zenhong" to "Update Li zenhong ", modify the text of the child node
Xmlnodelist nodelist = xmldoc. selectsinglenode ("Bookstore"). childnodes; // obtain all the subnodes of the bookstore NodeForeach (xmlnode Xn in nodelist) // traverses all subnodes{Xmlelement Xe =
"; Set text node
El. AppendChild (XESUB2);
Xmldocselect.appendchild (EL);
Xmldoc.save (Server.MapPath ("User.xml"));
}
modifying nodes
private void Updateelement ()
{
Loadxml ();
XmlNodeList Nodelist=xmldoc.selectsinglenode ("user"). ChildNodes; Gets all child nodes of the bookstore node
foreach (XmlNode xn in nodelist)//traverse all child nodes
{
XmlElement xe= (XmlElement) xn; To convert a child node type to a XmlElement type
if (
(XESUB2); Xmldocselect.appendchild (EL); Xmldoc.save (Server.MapPath ("User.xml")); } //Modify Node Private voidupdateelement () {LoadXml (); XmlNodeList NodeList=xmldoc.selectsinglenode ("User"). ChildNodes;//get all child nodes of the bookstore node foreach(XmlNode xninchNodeList)//Traverse all child nodes{XmlElement XE= (XmlElement) xn;//To Convert a child node type to a XmlElement type if(
"; // set a text nodeEl. AppendChild (xesub2 );XmldocSelect. AppendChild (el );XmlDoc. Save (Server. MapPath ("user. xml "));}// Modify a nodePrivate void UpdateElement (){LoadXml ();XmlNodeList nodeList = xmlDoc. SelectSingleNode ("user"). ChildNodes; // obtain all the subnodes of the bookstore NodeForeach (XmlNode xn in nodeList) // traverses all subnodes{XmlElement xe = (XmlElement) xn; // converts the subnode type to the XmlElement typeIf (
9== displays the total memory of the XenServer in the list, the available memory, the available memory than the "readable version"-----------------------For I in $ (Cat Pttile192.168.1.xxx192.168.1.xxxEof);d O{["$I" = "Pttile"] echo-e "namelabel:\t\tipaddress:\t\thostname:\t\tmemtotal:\t\tmemfree:\tmemp%:" | | SSH $I "For XX in \ '/opt/xensource/bin/xe host-list params=uuid--minimal|sed ' s/,//g ' \ 'DoIpaddress=\ '/opt/xensource/bin/
a text nodeEl. appendchild (xesub2 );
Xmldocselect. appendchild (EL );Xmldoc. Save (server. mappath ("user. xml "));
}
// Modify a nodePrivate void updateelement (){Loadxml ();Xmlnodelist nodelist = xmldoc. selectsinglenode ("user"). childnodes; // obtain all the subnodes of the bookstore NodeForeach (xmlnode Xn in nodelist) // traverses all subnodes{Xmlelement Xe = (xmlelement) xn; // converts the subnode type to the xmlelement typeIf (
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->-- R12 SLA subledger and GL general ledger association query
Select
Xte. application_id "application ",
Xte. entity_id,
Xte. ledger_id "Ledger SOB ",
Xte. entity_code,
Xett. name "transaction entity type ",
Le. name "legal entity ",
Le. legal_entity_identifier "person subject Income Tax Registration" -- legal_entity_tax
------------------------------
-- AP_INVOICES AP invoice INVOICE_ID
-- AP_PAYMEN
NodeEl. setattribute (name, Fengyun); // Add the property name of the person node.El. setattribute (sex, female); // Add the property sex of the person NodeEl. setattribute (age, 25); // Add the property age of the person node.Xmlelement xesub1 = xmldoc. createelement (PASS); // Add the node in the person NodeXesub1.innertext = 123; // set the text nodeEl. appendchild (xesub1 );Xmlelement xesub2 = xmldoc. createelement (Address );Xesub2.innertext = Kunming; // set the text nodeEl. appendchild (
system password:1. Forget the password, but you have logged on to the system.This solution is simple. First, enter "mmc. e xe, or press Win + R to open the Run window and enter "mmc. e xe, and click OK to enter the console. Open "file"-"Add/delete Management Unit" in sequence, find "local users and groups" in the available management unit on the left, and click "add"-"finish" in sequence ", click OK ". Exp
. appendchild (xesub2 );
Xmldocselect. appendchild (EL );Xmldoc. Save (server. mappath ("user. xml "));
}
// Modify a nodePrivate void updateelement (){Loadxml ();Xmlnodelist nodelist = xmldoc. selectsinglenode ("user"). childnodes; // obtain all the subnodes of the bookstore NodeForeach (xmlnode Xn in nodelist) // traverses all subnodes{Xmlelement Xe = (xmlelement) xn; // converts the subnode type to the xmlelement typeIf (
value of a nodeXmlElement XE =(XmlElement) xn1; //Get property values for type and ISBN two propertiestitle = Xe. GetAttribute ("title"). ToString (); Addtime= Xe. GetAttribute ("Addtime"). ToString (); Node=XE. InnerText; LIST
);
Root. appendchild (xe1); // Add it to the Xmldoc. Save ("Bookstore. xml ");// ================================================ ==========
Result:
[Run code] [copy to clipboard] [±]Code:
2. Modify the node: Change the genre value of the node whose genre attribute value is "Li zenhong" to "Update Li zenhong ", modify the text of the child node
[run code] [copy to clipboard] [±] code: xmlnodelist nodelist = xmldoc. selectsinglenode ("Bookstore "). childnodes; // obtain all subnodes
");Xesub2. innertext= "Kunming";/Set Text nodeEl. AppendChild (XESUB2);
Xmldocselect.appendchild (EL);Xmldoc.save (Server.MapPath ("User.xml"));
}
modifying nodesprivate void Updateelement (){Loadxml ();XmlNodeList Nodelist=xmldoc.selectsinglenode ("user"). childnodes;//gets all the child nodes of the bookstore nodeforeach (XmlNode xn in nodelist)//traverse all child nodes{XmlElement xe= (XmlElement) xn;//Converts a child node type to a XmlElement ty
); XmlNode xn = doc. selectSingleNode (Node); value = (attribute. Equals ("")? Xn. InnerText: xn. Attributes [attribute]. Value);} catch {} return value ;}////// Insert data //////Path///Node///Element name. if it is not Null, a new element is inserted. Otherwise, an attribute is inserted in the element.///Attribute name. if it is not null, the attribute value of this element is inserted. Otherwise, the element value is inserted.///Value///
/*************************************** * ***********
/xenserver hostVm-template templates that were previously definedVm-host-1 the VM that will be created
The following is my specific record of operations:Get the Vm-template UUID[Root@xenhost1 ~]# XE Vm-list | Grep-b 1 Vm-template
UUID (RO): C77040ae-3a50-9217-ff03-41992c34d1ec
2 Name-label (RW): vm-host-1
To modify the kernel boot mode and pass custom parameters[Root@xenhost1 ~]# Xe vm-param-set uuid=c7
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.