VC½âÎöXML ʹÓÃCMarkupÀà½âÎöXML
VC½âÎöXML--ʹÓÃCMarkupÀà½âÎöXML
(Ò») ÏȽ²Ò»ÏÂXMLÖеÄÎïÊâ×Ö·û£¬ÊÖ¶¯ÌîдʱעÒâһϡ£
×Ö·û ×Ö·ûʵÌå
& &»ò&
' '»ò'
> >»ò>
< <»ò&<
" "»ò"
(¶þ) CMarkupÀàµÄÔ´´úÂë¡£
ÕâÊÇĿǰµÄ×îа汾£»
ÕâÊǹÙÍøÊ¾ÀýÎļþ£¬È¡³öÀïÃæµÄMarkup.cppºÍMarkup.h£¬µ¼ÈëÄãµÄ¹¤³ÌÀïÃæ£¬CMarkupÀà¾Í¿ÉÒÔÓÃÁË£»
ÏÂÔØµØÖ·£ºhttp://www.firstobject.com/Markup112.zip¡¡2009Äê9ÔÂ3ÈÕ¹ÙÍø×îаæ
Èç¹ûÏÂÔØ²»ÁË£¬¿ÉÒÔµ½¹ÙÍøÈ¥ÏÂÔØ¡¡http://www.firstobject.com/dn_markup.htm¡¡
(Èý) ´´½¨Ò»¸öXMLÎĵµ¡£
CMarkup xml;
xml.AddElem( "ORDER" );
xml.AddChildElem( "ITEM" );
xml.IntoElem();
xml.AddChildElem( "SN", "132487A-J" );
xml.AddChildElem( "NAME", "crank casing" );
xml.AddChildElem( "QTY", "1" );
xml.Save("c:\\UserInfo.xml");
Ч¹ûÈçÏ£º
<ORDER>
<ITEM>
<SN>132487A-J</SN>
<NAME>crank casing</NAME>
<QTY>1</QTY>
</ITEM>
</ORDER>
(ËÄ) ä¯ÀÀÌØ¶¨ÔªËØ
CMarkup xml;
xml.Load("UserInfo.xml");
while ( xml.FindChildElem("ITEM") )
{
xml.IntoElem();
xml.FindChildElem( "SN" );
CString csSN = xml.GetChildData();
Ïà¹ØÎĵµ£º
protected void Page_Load(object sender, EventArgs e)
{
lblValue.Text = string.Format("{0:N}", 2500000);
lblValue.Text = string.Format("{0:C3}", 2);
......
public string WriteXML(string[] values, int flag)
{
//Èç¹ûflag==0ÔòΪµÚÒ»´ÎÔËÐÐÐèÒª³õʼ»¯XMLÎļþ
if (flag == 0)
{
//ÉúÔÚËæ»úÎļþÃû
string dateName = System.DateTime.Now.ToString("yyyyMMddHHmmss");
......
TinyXML£ºÒ»¸öÓÅÐãµÄC++ XML½âÎöÆ÷
¶ÁÈ¡ºÍÉèÖÃxmlÅäÖÃÎļþÊÇ×î³£ÓõIJÙ×÷£¬ÊÔÓÃÁ˼¸¸öC++µÄXML½âÎöÆ÷£¬¸öÈ˸оõTinyXMLÊÇʹÓÃÆðÀ´×îÊæ·þµÄ£¬ÒòΪËüµÄAPI½Ó¿ÚºÍJavaµÄÊ®·ÖÀàËÆ£¬ÃæÏò¶ÔÏóÐԺܺá£
TinyXMLÊÇÒ»¸ö¿ªÔ´µÄ½âÎöXMLµÄ½âÎö¿â£¬Äܹ»ÓÃÓÚC++£¬Äܹ»ÔÚWindows»òLinuxÖбàÒë¡£Õâ¸ö½âÎö¿âµÄÄ£ÐÍͨ¹ý½âÎöXMLÎļþ£¬È»ºóÔ ......
Îĵµ¼°´úÂëÏÂÔØ£ºhttp://www.dingos.cn/index.php?topic=1899.0
½éÉÜ
µ±²Ëµ¥ÏîÊǾ³£¸Ä±äʱ£¬´ÓXMLÎĵµÖд´½¨TreeView²Åµ±ÊǷdz£ÓÐÓõġ£ÀýÈ磬ʹÓÃXML×÷ΪÊý¾Ý¿â´æ´¢¼Ç¼¡£
ÕâÀïÓиö¼òµ¥Ê¾Àý¡£ÒÔ·À»ìÏýÕâ¸öÀý×ӱȽϼòµ¥¡£
±³¾°
¶ÔXML¡¢TreeView¿Ø¼þµÄÓ¦Óã¬ÔÚVisual StudioÖÐÓÐÖúÓÚÀí½âÕâЩ²½Öè¡£
ʹÓôúÂë
×¢Òâ ......
À©Õ¹±ê¼ÇÓïÑÔXML£¨eXtensible Markup Language£©£¬ÊÇÓÉW3C×éÖ¯ÖÆ¶¨µÄ¡£×öΪÓÃÓÚÌæ´úHTMLÓïÑÔµÄÒ»ÖÖÐÂÐ͵ıê¼ÇÓïÑÔ£¬XMLÄÚ²¿ÓÐןܶà»ù±¾±ê×¼£¬XML¾ÍÊÇͨ¹ýÓëÕâЩÏà¹Ø±ê×¼µØ½áºÏ£¬Ó¦ÓÃÓÚ¿ÆÑ§¼ÆËã¡¢µç×Ó³ö°æ¡¢¶àýÌåÖÆ×÷ºÍµç×ÓÉÌÎñµÄ¡£C££×÷ΪһÖÖÐÂÐ͵ijÌÐòÓïÑÔ£¬ÊÇ.Net¿ò¼ÜµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬ËûºÍXMLµÄ¹ØÏµÆÄÉî¡£±¾ÎÄ¾Í´Ó ......