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>
  • 相关阅读:
    Redis使用:聚合类型为空时,会自动被Redis删除
    Effective C++: 04设计与声明
    select引起的服务端程序崩溃问题
    Effective C++: 03资源管理
    Effective C++: 02构造、析构、赋值运算
    Effective C++: 01让自己习惯C++
    Centos7.2 安装配置 Tengine(nginx)
    Centos7更新阿里yum源
    Go中函数作为值、类型传递。
    go实现冒泡排序和快速排序
  • 原文地址:https://www.cnblogs.com/zno2/p/7338088.html
Copyright © 2011-2022 走看看