四眼看世界 XML语法
XML (EXtensible Markup Language)
XML is a
cross-platform, software and hardware independent tool for transmitting
information.
Prolog
XML
Declaration
Processing
Instructions
DOCTYPE
Declaration
Elements
Attributes
XML
Comments
CDATA
Sections
Character
and Entity References
XML
settings
XML processors
treat the character sequence Carriage Return-Line Feed (CRLF) like single CR or
LF characters. All are reported as a single LF character. Applications can save
documents using the appropriate line-ending convention.
Elements
XML documents must
contain one and only one root element
XML
Declaration
<?xml
version="1.0" encoding="UTF-8"?>
If used it must be the first line in the document and no other content or white space can precede it
Version
Declaration
The
version declaration is mandatory and the version number 1.0 is the latest
version currently
Encoding
Declaration
It
must contain a value representing an existing character encoding
Processing
Instructions
Processing
instructions do not have to follow much internal syntax, can include markup
characters without escaping them, and can appear anywhere in the document
outside of other markup. Processing instructions must begin with an identifier
called a target which is are case-sensitive.
Style Sheet
Processing Instructions
<?xml-stylesheet
type="type" href="uri" ?>
DOCTYPE
Declaration
<!DOCTYPE
rootElement PUBLIC "PublicIdentifier" "URIreference">
The
PublicIdentifier provides a separate identifier that some XML parsers can use to
reference the DTD in place of the URIreference. This is useful if the parser is
used on a system without a network connection or where that connection would
slow down processing significantly
XML
Comments
<!--
-->
Comments cannot be
nested
CDATA
Sections
<![CDATA[
]]>
Character
references do not work within CDATA sections.
CDATA
相关文档:
标签:数据访问 ADO.NET
处理XML片段 处理片段时,只是把XElement(而不是XDocument)当作顶级XML对象。
片段的唯一限制是,不能添加比较节点类型,例如:XComme ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace System.Bwch.XmlConfig
{
/**////
/// 读取XML配置文件类
///
public class XmlHelper
{
private string strXmlPath = ""; //Xml文档路径
private XmlDocument xmlD ......
using System.Xml;//头部加此命名空间
XmlDocument xd = new XmlDocument();//表示XML文档
XmlDeclaration xde;//表示 XML 声明节点:<?xml version='1.0'...?>
xde = xd.Cre ......
using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using FilmOnLine.Model;
namespace FilmOnLine.DAL
{
public static class FilmService
{
/// <summary>
/// 添加电影
/// </summary ......
//获取数据库数据返回list
public List queryAll(int fcateId) {
List list = new ArrayList();
String sql = "select * from g_Account where fCateID=? order by fCode";
Connection con = SqlHelp.getConn();//获得连接,sqlhelp自己写的工具类
PreparedStatement pst = null;
ResultSet rs = null;
......