posts - 35,  comments - 6,  trackbacks - 0

                剛開始學(xué)習(xí)xmlBean覺得非常好用,所以邊學(xué)習(xí),邊開始整理一些應(yīng)用,供留備.
                在xmlbeans2.2\samples\OrderMatters有很多例子,我就是參照學(xué)習(xí)的^-^;
                

          1,創(chuàng)建ServicesDocument

           1 public static ServicesDocument parseXml(String filePath) throws Exception {
           2         File file = new File(filePath);
           3         ServicesDocument sd = null;
           4         if (file.exists()) {
           5             try {
           6                 sd = ServicesDocument.Factory.parse(file);
           7             } catch (Exception e) {
           8                 throw new Exception(e.toString());
           9             }
          10         }
          11         else{
          12             sd = createServicesDocument();
          13         }
          14         return sd;
          15     }
          16 

          2,應(yīng)用ServicesDocument可以取得你定義的xml對象節(jié)點(diǎn)進(jìn)行操作
               1)當(dāng)你在xsd中定義了節(jié)點(diǎn)為maxOccurs="unbounded"時(shí)

           1 Workflow[] wfs = ses.getWorkflowArray();
           2         String pacId = workflow.getPackageDefId();
           3         String proDefId = workflow.getProcessDefId();
           4         String actDefID = workflow.getActivityDefId();
           5         for (int i = 0; i < wfs.length; i++) {
           6             Workflow existWorkflow = wfs[i];
           7             if (pacId.equals(existWorkflow.getPackageDefId())
           8                     && proDefId.equals(existWorkflow.getProcessDefId())
           9                     && actDefID.equals(existWorkflow.getActivityDefId())) {
          10                 ses.removeWorkflow(i);
          11                 break;
          12             }
          13         }


          posted on 2007-04-28 07:57 NG 閱讀(173) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(1)

          隨筆檔案(35)

          文章分類(5)

          文章檔案(2)

          新聞檔案(5)

          java link

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 南召县| 伊吾县| 东山县| 乡城县| 临沭县| 沁源县| 留坝县| 磴口县| 古浪县| 沛县| 崇左市| 沽源县| 黑龙江省| 红安县| 二连浩特市| 乐陵市| 铁力市| 上饶县| 河西区| 玉门市| 鹤壁市| 湘乡市| 务川| 沙湾县| 金堂县| 无锡市| 嘉峪关市| 碌曲县| 龙游县| 佛冈县| 旌德县| 万盛区| 长兴县| 丽江市| 昌乐县| 绿春县| 卓资县| 隆化县| 和平区| 寿宁县| 高邮市|