当然了.也不是特指aspx页面,其实是html页面.是这样的. 我现在有个A.aspx页面,然后里面的代码段是这样的
<object type="application/x-shockwave-flash" data="cc.swf" width="650" height="500" id="cc">
<param name="FlashVars" value="<script language="javascript" src="B.aspx"></script>"/>
</object>
上面的B.aspx我是用document.write() 的方法来读出下面的xml格式文档的<url>
 <item>
   <ok>
i am here!
   </ok>
 </item>
</url>所以整个B.aspx页面的源码就是这样:
document.write('<url><item><ok>i am here!</ok></item></url>');发现这样根本读不了.为什么?如何解决?谢谢!

解决方案 »

  1.   

    document.write(' <url> <item> <ok>i am here! </ok> </item> </url>'); 
    可能是Html里不能识别你自定义的标记造成的<ok>
      

  2.   

    这样写protected void Page_Load(object sender, EventArgs e)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(Server.MapPath("data.xml"));
            XmlNode node = doc.DocumentElement;
            XmlNode book = node.SelectSingleNode ( "//book[@id='01']" );
            XmlElement bookName = doc.CreateElement ( "name" );
            bookName.InnerText = "Xiyouji";
            XmlAttribute numbers = doc.CreateAttribute ("numbers");
            numbers.Value = "100";
            bookName.Attributes.Append ( numbers );
            book.AppendChild ( bookName );
            doc.Save ( Server.MapPath ( "data.xml" ) );
        }生成格式如:<?xml version="1.0" encoding="gb2312"?>
    <root>
      <library>
        <book id="01">
          <name numbers="100">Xiyouji</name>
        </book>
        <book id="02">
          <name numbers="100">Hongloumeng</name>
        </book>
      </library>
    </root>你按照你的需求改改就可以了