zoukankan      html  css  js  c++  java
  • xml to xsd ; xsd to xml

    xml to xsd

    工具网站

    https://www.freeformatter.com/xsd-generator.html

    http://xmlgrid.net/xml2xsd.html

    示例xml

    <?xml version="1.0"?>
    <!DOCTYPE note SYSTEM "note.dtd">
    <note>
      <to>Tove</to>
      <from>Jani</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend!</body>
    </note>

    示例xsd结果

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="note">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="to"/>
            <xs:element type="xs:string" name="from"/>
            <xs:element type="xs:string" name="heading"/>
            <xs:element type="xs:string" name="body"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    xsd to xml

    Spring Tool Suite 4 -> 右键 xsd 文件 -> Generate -> XML File... -> File Name -> Next -> Create optional attributes & create optional elements & Limit optional elment depth to:  -> OK

    如下示例:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE configuration SYSTEM "mybatis-3-config.dtd" >
    <configuration>
      <properties resource="" url="">
        <property name="" value=""/>
      </properties>
      <settings>
        <setting name="" value=""/>
      </settings>
      <typeAliases>
        <typeAlias alias="" type=""/>
        <package name=""/>
      </typeAliases>
      <typeHandlers>
        <typeHandler handler="" javaType="" jdbcType=""/>
        <package name=""/>
      </typeHandlers>
      <objectFactory type="">
        <property name="" value=""/>
      </objectFactory>
      <objectWrapperFactory type=""/>
      <reflectorFactory type=""/>
      <plugins>
        <plugin interceptor="">
          <property name="" value=""/>
        </plugin>
      </plugins>
      <environments default="">
        <environment id="">
          <transactionManager type="">
            <property name="" value=""/>
          </transactionManager>
          <dataSource type="">
            <property name="" value=""/>
          </dataSource>
        </environment>
      </environments>
      <databaseIdProvider type="">
        <property name="" value=""/>
      </databaseIdProvider>
      <mappers>
        <mapper class="" resource="" url=""/>
        <package name=""/>
      </mappers>
    </configuration>
  • 相关阅读:
    wpf 获取datagrid中模板中控件
    WPF DataGrid DataGridTemplateColumn 控制模板中控件
    ztree实现拖拽移动和复制
    layui的select监听
    layui父页面获取子页面数据
    win10安装网络适配器
    bat启动OpenOffice4
    java注解简单使用
    win7安装IIS
    java的Array和List相互转换
  • 原文地址:https://www.cnblogs.com/zno2/p/7338088.html
Copyright © 2011-2022 走看看