Autodesk Vault API ÀàµÄXml Serialization¹¥ÂÔ
Òë×ÔVault API°ïÖúÎĵµÖÐһƪ Doug RedmondдµÄknowledgebase article. Doug's ²©¿ÍÊÇ It's All Just Ones and Zeros
ÄãÒ²Ðí²»ÖªµÀËùÓÐVault API À඼¿ÉÒÔ XML ÐòÁл¯ - ÕâÒâζןÜÈÝÒ×°ÑAPI¶ÔÏóת»»Îª XML Îı¾£¬·´Ö®ÒàÈ»¡£
ºÜ¶àÖÖÇé¿öÏ¿ÉÒÔʹÓô˹¦ÄÜ£¬ÀýÈ磺
Ëü¿ÉÒÔ°ïÖúÄúµ÷ÊÔ´úÂë¡£Èç¹ûÄú¾ßÓдóÁ¿Êý¾ÝµÄ¶ÔÏ󣬽«¸Ã¶ÔÏó´æΪXML¸ñʽ·½±ãÑо¿¡£
Èç¹ûÄúÏòADNÌá½»ÎÊÌ⣬¿ÉÒÔ½«XMLÐòÁл¯µÄ¶ÔÏó×÷ΪÄúµÄÎÊÌâ˵Ã÷µÄÒ»²¿·Ö¡£
´æ´¢ÐÅÏ¢¹©ÒÔºóʹÓá£Ö»Ðè¼Çס£¬´ËÐÅÏ¢ÔÚÏÂÒ»°æ±¾ÖпÉÄÜ»á¸ü¸Ä¡£
Äú¿ÉÒÔʹÓÃXMLÐòÁл¯ºóµÄÐÅÏ¢×÷Ϊ¼ì²â¶ÔÏóÊÇ·ñÒÑ·¢Éú±ä¸üµÄ²ÎÕÕÎï¡£ÀýÈçÄú±àдÁËÒ»¸öÉèÖÃÉúÃüÖÜÆڵijÌÐò£¬ÄúÏ£ÍûÄúµÄ³ÌÐò¼ì²âµ½ÊÇ·ñÓÐÈ˸ÉÔ¤ÁËÉúÃüÖÜÆÚÉèÖá£
ÏÂÃæÊÇһЩVault API XML ÐòÁл¯µÄʾÀý´úÂ룺
C#:
private bool DidItChange(LfCycDef def)
{
// serialize the object
StringBuilder currentXML = new StringBuilder();
XmlSerializer serializer = new XmlSerializer(typeof(DocEx.LfCycDef));
using (TextWriter writer = new StringWriter(currentXML))
{
serializer.Serialize(writer, def);
}
// read in the stored XML
string originalXML = System.IO.File.ReadAllText("correct.xml");
// now all you have to do is compare the two
return (originalXML != currentXML.ToString()); }
VB:
private function DidItChange(def as LfCycDef ) as boolean
' serialize the object
dim currentXML as StringBuilder = new StringBuilder()
dim serializer as XmlSerializer = new XmlSerializer(GetType(LfCycDef))
using writer as TextWriter = new System.IO.StringWriter(currentXML)
serializer.Serialize(writer, def)
end using
' read in the stored
Ïà¹ØÎĵµ£º
ͨ¹ýµ÷ÓÃCreateDataSetfromXmlÈ¡µÃXMLÊý¾Ý
Imports System.Xml
Public Const FILE_CONFIG = "MZZ.xml"
Public Const PATH_CONFIG = "\XML\"
Dim dstXML As DataSet
Dim tblXML_DB As DataTable
Dim dtCod As New DataTable
Dim strSQL As String = ""
clsPublic ......
±¾ÎĽéÉÜÁ˸÷ÖÖ½âÎö·½·¨£¬×ÅÖØ·ÖÎöÁ˸÷×ÔµÄÓÅȱµã:
½âÎöµÄÖØÒªÐÔ
¡¡¡¡½âÎöΪʲôÖØÒª?ÒòΪËùÓÐ XML ´¦Àí¶¼´Ó½âÎö¿ªÊ¼¡£ÎÞÂÛʹÓø߲ã±à³ÌÓïÑÔ(Èç XSLT)»¹ÊǵͲã Java ±à³Ì£¬µÚÒ»²½¶¼ÊÇÒª¶ÁÈë XML Îļþ£¬½âÂë½á¹¹ºÍ¼ìË÷ÐÅÏ¢µÈµÈ£¬Õâ¾ÍÊǽâÎö¡£
¡¡¡¡½âÎöÎĵµÊ±ÃæÁٵĵÚÒ»¸öÑ¡ÔñÊDzÉÓÃÏֳɵĽâÎö¿â(»ù±¾ÉÏÿÖÖ±à³ÌÓïÑÔ¶¼Ó ......
²Î¿¼²©ÎÄ¡¶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 ......
XMLºÍHTML³£ÓÃתÒå×Ö·û
XMLºÍHTMLÖж¼ÓÐһЩÌØÊâµÄ×Ö·û£¬ÕâЩ×Ö·ûÔÚXMLºÍHTMLÖÐÊDz»ÄÜÖ±½ÓʹÓõģ¬Èç¹û±ØÐëʹÓÃÕâЩ×Ö·û£¬Ó¦¸ÃʹÓÃÆä¶ÔÓ¦µÄתÒå×Ö·û¡£
Èç¹ûÔÚXMLÎĵµÖÐʹÓÃÀàËÆ"<" µÄ×Ö·û, ÄÇô½âÎöÆ÷½«»á³öÏÖ´íÎó£¬ÒòΪ½âÎöÆ÷»áÈÏΪÕâÊÇÒ»¸öÐÂÔªËصĿªÊ¼¡£
ËùÒÔ²»Ó¦¸ÃÏñÏÂÃæÄÇÑùÊéд´úÂë:
<message&g ......