本帖最后由 solszl 于 2010-04-30 13:16:38 编辑

解决方案 »

  1.   

    <?xml version="1.0"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:for-each select="//@*">
    <xsl:value-of select="name()"/>=
    <xsl:value-of select="."/><br/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet> 
      

  2.   

    额。。不好意思啊。。我才接触xml编程。。
    我想用c#程序来实现。不知道能不能教我一下。谢谢了
      

  3.   

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Xml;public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(MapPath("x.xml"));        XmlNodeList nodeList;        nodeList = doc.SelectNodes("//@*");
            foreach (XmlNode n in nodeList)
            {
                Response.Write(n.Value);
            }
        }
    }
      

  4.   

    这个确实或得到了 所有的结果。可是问题又来了
    在根节点 加上这句话就不对了。
    如果XML变成这样
    <?xml version="1.0" encoding="utf-8"?>
    <a  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"  aa="1" bb="2" cc="3">
      <b dd="4"></b>
      <c>
      <d ee="5"></d>
      </c>
    </a>