比如我有这么一个xml文件:我想写成这个样子的,请哪位指教下怎么写??<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.fujitsu.com/xbrl/taxeditor/default" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p0="http://www.fujitsu.com/xbrl/taxeditor/default" xmlns:link="http://www.xbrl.org/2003/linkbase" 
xmlns:xbrli="http://www.xbrl.org/2003/instance" 
xmlns:xlink="http://www.w3.org/1999/xlink">
  <xsd:annotation>
    <xsd:appinfo>
      <link:linkbaseRef xlink:type="simple" xlink:href="cfid-presentation.xml"   xlink:role="http://www.xbrl.org/2003/role/presentationLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
      <link:linkbaseRef xlink:type="simple" xlink:href="cfid-calculation.xml" xlink:role="http://www.xbrl.org/2003/role/calculationLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
      <link:linkbaseRef xlink:type="simple" xlink:href="cfid-label.xml" xlink:role="http://www.xbrl.org/2003/role/labelLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
      <link:linkbaseRef xlink:type="simple" xlink:href="cfid-reference.xml" xlink:role="http://www.xbrl.org/2003/role/referenceLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
    </xsd:appinfo>
  </xsd:annotation>
  <xsd:import namespace="http://www.xbrl.org/2003/instance" schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
  <xsd:import namespace="http://www.xbrl.org/2003/linkbase" schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/>
  <xsd:element name="newItem" id="p0_newItem" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" nillable="true" xbrli:periodType="instant"/>  
</xsd:schema>

解决方案 »

  1.   

    XMLDocument类里面有对XML的操作,LZ建议去查一下MSDN,先看看如何操作XML。
      

  2.   

    msdn xml
      

  3.   

    示例如下:
    using System.xml;
    using System.xml.xPath;
    using System.IO; string lc_Xml = string.Empty;
                StringWriter lc_sw = new StringWriter();            try
                {
                    XmlWriterSettings xwset = new XmlWriterSettings();
                    xwset.Indent = true;
                    xwset.OmitXmlDeclaration = false;
                    XmlWriter xw = XmlWriter.Create(lc_sw, xwset);
                    try
                    {
                        xw.WriteStartDocument();
                        xw.WriteStartElement("DataSet");                    .........内容省略
     
                        xw.WriteEndElement();
                        xw.WriteEndElement();
                        xw.WriteEndDocument();
                    }
                    finally
                    {
                        xw.Close();
                    }
                    lc_Xml = lc_sw.ToString();
                }
                finally
                {
                    lc_sw.Close();
                }
                return lc_Xml;
      

  4.   

    xmldatasourse能解决这个问题,根据这个来,
      

  5.   

    MSDN上有实例 你去看下吧~