Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃVelocity+zip+xml¿ìËÙ¹¹½¨word2007Îĵµ

¼¼Êõ½éÉÜ
     ÔÚÒ»°ãµÄJavaÏîÄ¿ÖÐ,Éú³ÉwordÎĵµµÄʱºò,ÎÒÃÇ»áʹÓõ½jacobÀ´×÷ΪÎÒÃÇÉú³ÉwordÎĵµµÄ¹¤¾ß,µ«ÊÇjacobÊÇͨ¹ýʹÓÃJNIµ÷ÓÃdllÎļþÀ´ÊµÏÖ,ÕâÑùµÄ¹¤×÷·½Ê½´øÀ´Á˼«´óµÄÐÔÄÜ¿ªÏú.ÕâÀïÎÒÃDzÉÓÃVelocity+zip+xml¿ìËÙ¹¹½¨word2007Îĵµ,ËùÒÔ˵Õâ¸ö¼¼ÊõʵÏÖÓÐÒ»¶¨µÄ¾ÖÏÞÐÔ,Éú³ÉµÄ±ØÐëÊÇword2007Îĵµ.
     ÎÒÃÇÏÈÀ´Á˽âÏÂword2007Îĵµ,word2007Îĵµ±¾ÉíÊÇÒÔxmlÎļþ¸ñʽ´æ´¢µÄ,È»ºó½«Ïà¹ØµÄxmlÎļþºÍ×ÊÔ´ÎļþѹËõµÃµ½.ΪÁËÈôó¼Ò¸ü¼ÓÃ÷°×,ÏÈÀ´×ö¸öСʵÑé,ÎÒÃÇн¨Ò»¸öword2007Îĵµ,È»ºó´ò¿ªºóËæ±ãÊäÈëһЩÄÚÈÝ,±£´æºó,½«ÆäÀ©Õ¹ÃûdocxÐÞ¸ÄΪzip.È»ºóÄã»á·¢ÏÖÕæµÄ¿ÉÒÔÓÃѹËõ¹¤¾ß²é¿´.Ŀ¼½á¹¹ÈçÏÂ.
©¦  [Content_Types].xml
©¦
©À©¤docProps
©¦      app.xml
©¦      core.xml
©¦
©À©¤word
©¦  ©¦  document.xml
©¦  ©¦  endnotes.xml
©¦  ©¦  fontTable.xml
©¦  ©¦  footnotes.xml
©¦  ©¦  settings.xml
©¦  ©¦  styles.xml
©¦  ©¦  webSettings.xml
©¦  ©¦
©¦  ©À©¤theme
©¦  ©¦      theme1.xml
©¦  ©¦
©¦  ©¸©¤_rels
©¦          document.xml.rels
©¦
©¸©¤_rels
        .rels
     ÕâÀïÎļþ±È½Ï¶à,µ«ÊÇÎÒÃÇÐèÒª¹ØÐĵÄÎļþÖ»ÓÐdocument.xmlÎļþ.ÕâÑùÎÒÃǾͽ«¹¹½¨word2007ÎĵµµÄÎÊÌâת»¯³ÉÐÞ¸ÄÒ»¸öѹËõÎļþÖеÄxmlÎÊÌâ,ËùÒÔÎÒÃÇ»áʹÓõ½zipÀ´´¦ÀíѹËõÎļþ,ÓÉÓÚ¶Ôdocument.xmlÎĵµµÄ¶¨Òå±È½Ï¸´ÔÓ,ÕâÀïÎÒÃDzÉÓÃÄ£°åµÄ·½Ê½À´ÐÞ¸Ädocument.xmlÎĵµ,ËùÒÔÎÒÃÇÓõ½ÁËÇ¿´óµÄÄ£°åÒýÇæ,velocity.
    »ù±¾ÉÏÓõ½µÄ¼¼ÊõºÍʵÏÖ²ßÂÔÒѾ­½éÉܵò¶àÁË,ÏÂÃæÎÒÃÇ¿´¿´ÈçºÎʵÏÖ.
µÚÒ»²½:´´½¨Ä£°å
н¨Ò»¸öĿ¼,ÎÒÃÇÕâÀïÃüÃûΪmytemplate,
ÔÚĿ¼ÏÂн¨Ò»¸öword2007Îĵµ,ÊäÈëÏÂÃæÄÚÈÝ
ÐÕÃû:${name}
ÐÔ±ð:${sex}
    ±£´æÎÄÕÂÄÚÈݺó,½«ÆäÀ©Õ¹Ãû¸ÄΪzip,ʹÓÃѹËõ¹¤¾ß´ò¿ª,½«ÆäÖеÄdocument.xmlÎļþ½âѹһ·Ýµ½µ±Ç°Îļþ¼ÐϵÄwordĿ¼.(×¢Òâ²»Òª½«ËùÓÐÎļþ½âѹ,Ö»½âѹһ¸öÎļþ¼´¿É,µ±ËùÓÐÎļþ½âѹºó,ÖØÐÂѹËõºó,word»áÎÞ·¨½âÎö,¾ßÌåÔ­Òò»¹²»ÊǺÜÇå³þ)
È»ºó´ÓѹËõÎ


Ïà¹ØÎĵµ£º

D Busѧϰ£¨¾Å£©£ºÀûÓÃXML¶¨ÒåD BusÖ®SingalÊÕ·¢Àý×Ó


¡¡¡¡ÔÚÇ°ÃæÎÒÃÇѧϰÁËʹÓÃGlibµÄ¸ß³ÌÀ¦°ó·½Ê½µÄmethodµÄÊÕ·¢£¬ÏÖÔÚѧϰsingalµÄÊÕ·¢£¬xmlÀý×ÓÈçÏÂ
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/com/wei/MyObject">
  <interface name="com.wei.MyObject.Sample">
    < ......

XML²Ù×÷´óÈ«

ÐèÒªÌí¼ÓµÄÃüÃû¿Õ¼ä£º
using System.Xml;
¶¨Ò弸¸ö¹«¹²¶ÔÏó£º
XmlDocument xmldoc ;
XmlNode xmlnode ;
XmlElement xmlelem ;
1£¬´´½¨µ½·þÎñÆ÷ͬÃûĿ¼ÏµÄxmlÎļþ£º
·½·¨Ò»£º
xmldoc = new XmlDocument ( ) ;
//¼ÓÈëXMLµÄÉùÃ÷¶ÎÂä,<?xml version="1.0" encoding="gb2312"?>
XmlDeclaration xmldecl;
xml ......

DataSetÓëxmlÎļþµÄ»¥Ïàת»»


http://www.cnblogs.com/long2006sky/articles/1258731.html
DataSetת»»ÎªxmlÎļþ
//½«DataSetת»»ÎªxmlÎļþ
        private static void ConvertDataSetToXMLFile(DataSet xmlDS, string xmlFile)
        {
    &n ......

DataTable.Select½øÐÐXMLÊý¾ÝµÄ²éѯ

×î½üÔÚ²©¿ÍÔ°´úÂëµÄÖع¹ÖÐ, ÎÒ·¢¾õÓÃDataTable.Select½øÐÐXMLÊý¾ÝµÄ²éѯҲÊÇͦ·½±ãµÄ¡£
±ÈÈçÎÒÃǸù¾ÝUrlÖвÎÊýÖµ²éѯXMLÊý¾ÝÖÐÏàÓ¦½ÚµãµÄÊý¾Ý¡£
¼ÙÈçÎÒÃÇÓÐÕâÑùµÄXmlÊý¾ÝÎļþCatalog.xml:
<Navigation>
      <Catalog title="·Ç¼¼ÊõÇø" url="default.aspx?cate=2" rss="MainFeed.as ......

XmlÐòÁл¯ºÍ·´ÐòÁл¯

¾­³£¼ûXMLÐòÁл¯µÄÎÄÕ£¬¶Ô¸ÃÐòÁл¯·½Ê½²¢²»ÊÇÌ«ÏþµÃ£¬¿´ÁËMSDNºÍһЩ×ÊÁϺóÓÐÁË´óÖµÄÁ˽⣬´óµÀÀí½²²»³öÀ´£¬ÉÏ ´úÂëÏÈ£º
·½Ê½Ò» ͨ¹ýXmlSerializeÖ±½ÓÐòÁл¯£º
Class BeSerialized
{
//ij×Ö¶Î
public int someFiled; 
//¹«¹²ÀàµÄÒ»¸ö¿ÉÐòÁл¯µÄÊôÐÔ
private bool serialme;
public bool SerialMe
{
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ