首页 > 其他 > 详细

使用xig工具从schema生成schema实例

时间:2015-04-07 17:45:14      阅读:200      评论:0      收藏:0      [点我收藏+]

1,下载xig工具,xml-xig-0.1.1.jar可以到一下链接下载

  

2.编写schema文件,如下:

  

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns="http://my.soa.com"
   targetNamespace="http://my.soa.com"
   elementFormDefault="qualified">
 <xs:element name="person" >
 <xs:complexType>
 <xs:sequence>
 <xs:element name="firstname" type="xs:string"/>
 <xs:element name="lastname" type="xs:string"/>
 </xs:sequence>
 </xs:complexType>
 </xs:element>
   
   </xs:schema>

3.运行命令行:

  技术分享

4.person.xsd.xml文件如下:

<person>
  <firstname>?{string}</firstname>
  <lastname>?{string}</lastname>
</person>

4person.xig

 

<xig:template document='person' schema='e:/xmlw?/person.xsd' xmlns:xds='http://xml-xsd.sourceforge.net/schema/XmlXsd-0.1'>
  <person>
    <firstname>${xs:string}</firstname>
    <lastname>${xs:string}</lastname>
  </person>
  <xig:generate>
    <!-- Generate instance documents from template document above -->
    <loop count='10'>
    </loop>
  </xig:generate>
</xig:template>

     

使用xig工具从schema生成schema实例

原文:http://blog.csdn.net/u013998070/article/details/44921617

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!