xml节点信息
xml:
<?xml version="1.0" encoding="utf-8" ?>
<library>
<name>首都图书馆</name>
<address>朝阳区华威桥南</address>
<books>
<book type="math">
<id>0000</id>
</book>
<book type="computer">
<id>0001</id>
<name>Xml初学</name>
<publisher>人民出版社</publisher>
<publishdate>2010-05-0-18</publishdate>
<fee>100.54</fee>
</book>
<book type="computer">
<id>0002</id>
<name>XSD定义</name>
<author>子弟</author>
<publisher>子弟出版社</publisher>
<publishdate>2010-05-0-18</publishdate>
<fee>102.54</fee>
</book>
</books>
</library>
cs:
XmlDocument doc=new XmlDocument();
doc.Load(System.AppDomain.CurrentDomain.BaseDirectory+"/htmlxml/books.xml");
XmlNodeList nodelist = doc.GetElementsByTagName("book");
XmlElement element = doc.GetElementById("b3");
XmlNode node = doc.SelectSingleNode("library/books/book[2]");
XmlNodeList nodelistselect = doc.SelectNodes("library/books/book");
Response.Write("Name: " + node.Name + "<br/>");
&n
相关文档:
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
public class XMLReader {
priv ......
SQl Xml和C# Xml数据的一点操作总结
在此申明Xml是InfoSet数据不是字符串,所以在此强烈反对用string拼接xml。数据库可以存放xml类型数据,那么该数据的具体操作又如何了。
1.首先建立一张含有xml数据类型的表
CREATE TABLE [dbo].[TestXml](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Message] [xml] NULL ......
是否厌倦了用xml文件来做Magento的页面布局,是的话来试试下面这种方式,把布局代码写到controller 里面
public function mycoolAction()
{
/* ... Some code ...*/
$update = $this->getLayout()->getUpdate();
/* ... Some code ...*/
$this->addActionLayoutHandles();
/* ... Some code ...*/
......
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.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;
using System.Text; ......
参考博文《IE下利用jQuery分析XML》地址:http://www.newmediafun.com/2009/07/parsing-xml-with-jquery-in-internet-explorer/
本来以为jQuery会很好的解决所有浏览器兼容性问题,但是阵亡的IE6还是会找麻烦!
jQuery使用AJAX时,在IE6下读取回传到XML数据会有问题,具体看下面的例子吧。
准备数据文件test.xml
<Ar ......