Basic features of XML
Q: What is XML
XML is an Extensible Markup language, and XML is a simple data storage language.
Q: Briefly describe the common areas and advantages of XML
XML has the characteristics of separation of content and structure, strong interoperability, standardization and support of many coding formats, and it is because of these advantages that XML has been applied in many fields such as data exchange, Web Service, e-commerce, configuration file and so on.
How namespaces in Q:xml are used
Namespaces are used to modularize elements in an XML document, and you need to specify the name of the namespace when the parser tries to read a node under a particular namespace.
Use. NET component reads and writes XML
Q:. What are the basic types of operations XML in net
. The types of XML document operations that are supported in net are defined under the System.Xml namespace. The types of direct manipulation XML can be divided into two categories, one is the read-write type of XML and the other is the support type of the DOM.
Q: How to manipulate the nodes and attributes of an XML document using the XmlDocument type
Some of the test code is posted below:
classProgram {Static voidMain (string[] args) { stringXmlpath ="Test.xml"; XmlDocument XML=NewXmlDocument (); Xml. Load (Xmlpath); Console.WriteLine ("the original XML document is:"); Printxmldocument (XML); Console.WriteLine ("After you create a new node:"); AddNode (XML); Printxmldocument (XML); Console.WriteLine ("after editing the node:"); Editnode (XML); Printxmldocument (XML); Console.ReadLine (); } Static voidprintxmldocument (XmlDocument XML) {XML. Save (Console.Out); Console.WriteLine (); } Static voidAddNode (XmlDocument xml) {XmlNode NewNode= XML. CreateElement (" Book"); XmlAttribute Newattribute= XML. CreateAttribute ("name"); Newattribute.value="BOOK3"; NewNode.Attributes.Append (Newattribute); XmlNode Auth= XML. CreateElement ("Auth"); Auth. InnerText="Z3"; XmlNode Date= XML. CreateElement ("Date"); Date. InnerText="2011-10-1"; Newnode.appendchild (auth); Newnode.appendchild (date); Xml. Documentelement.appendchild (NewNode); } Static voideditnode (XmlDocument xml) {XmlNode node=XML. DocumentElement; XmlNode Editnode= node. Childnodes[node. Childnodes.count-1]; editnode.attributes["name"]. Value ="Book4"; Editnode.selectsinglenode ("Auth"). InnerText ="Z4"; Editnode.selectsinglenode ("Date"). InnerText ="2012-09-18"; } Static voiddeletenode (XmlDocument xml) {XmlNode node=XML. DocumentElement; XmlNode RemoveNode= node. Childnodes[node. Childnodes.count-1]; RemoveNode.Attributes.RemoveAt (0); Node. RemoveChild (RemoveNode); } }
Working with XML documents with XSLT
Q: What is the role of XSLT,XSLT?
XSLT is a language that formats XML documents by using XPath to extract the required content from an XML document and to organize new formats according to specific syntax.
Excerpt-it Enterprise must read 200. NET face question -10 application and processing of XML