¹ýÂËxmlÊý¾Ý
ÎÒÏë·ÃÎÊxmlµ±ÖÐijЩÊý¾Ý£¬»òÕßÊÇÏ£ÍûÓиö°´Å¥ÓиöÊäÈëÎı¾µã»÷°´Å¥ºó¹ýÂ˵ôÊäÈëÎı¾µÄÄÚÈÝ£¬¸ÃÈçºÎ×ö£¿
XMLListCollectionÖеĹýÂ˺¯Êý¿ÉÒÔ°ïÎÒÃÇ×öµ½Õâµã£¡Ê¾ÀýµÄ¹Ø¼üº¯ÊýÈçÏ£¬ÖÁÓÚxmlÓÐÐËȤµÄÅóÓÑ×Ô¸öд
import mx.collections.XMLListCollection;
protected var col:XMLListCollection;
protected var menuItemXml:XML;
private function init():void
{
menuItemXml=menuItem;
menuBarAppliation.dataProvider=menuItemXml.children();
}
private function filterBtnClickHandler(e:MouseEvent):void
{
col=new XMLListCollection(menuItemXml.menuItems);
col.filterFunction=labelFilter;
//´Ë´¦ÒªË¢Ð£¬·ñÔòÎÞЧ
col.refresh();
menuBarAppliation.dataProvider=col;
}
private function labelFilter(value:Object):Boolean
{
if (value.@label == 'Óû§ÐÅÏ¢¹ÜÀí')
{
return false;
}
return true;
}
Ïà¹ØÎĵµ£º
ÀûÓÃsqlhelperÖеÄExcuteXmlReader·½·¨£¬¶ÁÈ¡Êý¾Ý²¢±£´æΪxmlÎļþ
string strConn = Properties.Settings.Default.Connections;
SqlConnection connection = new SqlConnection(strConn);
& ......
µÚÒ»ÖÖ·½Ê½--ʹÓÃMSXML2.DOMDOCUMENT.4.0
´´½¨xmldoc¶ÔÏ󣬲¢×°ÔØÒ»¸öxml
Set xmldoc = CreateObject("MSXML2.DOMDOCUMENT.4.0")
xmldoc.loadXML ("Ò»¸ö¾ßÌåµÄXMLʵÌå")
Ñ¡ÔñÐèҪɸѡµÄ½áµã
Set nodeList = xmldoc.selectNodes("//*[count(ancestor::*)= 2]") '¸ù½ÚµãµÄµÚ¶þ´úºó´ú
Set nodeList = xmldoc ......
java ´úÂë
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList; ......
Javaͨ¹ýXML SchemaУÑéXML
XMLµÄУÑéÔÚXML´¦ÀíÖзdz£³£¼û£¬Èç¹ûûÓÐÓÐЧµÄ°ì·¨À´Ð£ÑéXMLµÄºÏ·¨ÐÔ£¬ÍùÍù»áµ¼ÖºܶàÎÊÌâ¡£
XMLµÄУÑéÊÇͨ¹ýXML Schema£¨XSD£© »òDTDÎļþµÄÓï·¨¹æ·¶À´Ð£ÑéµÄ¡£DTDÏÖÔÚÔ½À´Ô½²»ÊÜ»¶ÓÁË£¬ÔÚ´ËÑ¡ÓÃXSDÀ´Ð£Ñé¡£
JavaУÑéXMLÊǼþºÍ³¶µµÄÊÂÇ飬ÒòΪSunµÄXMLÏà¹ØÈí¼þ°ü» ......
protected void Page_Load(object sender, EventArgs e)
{
lblValue.Text = string.Format("{0:N}", 2500000);
lblValue.Text = string.Format("{0:C3}", 2);
......