zoukankan      html  css  js  c++  java
  • 如何写一个schema文件

    <!-- xmlns:默认的命名空间,一个 schema中只允许有一个xmlns,因为应用这个命名空间的资源不用添加前缀,其他的命名空间需要添加前缀 -->
    <!-- targetNamespace:是别的schema或者xml文件引用本schema文件的路径, -->
    <!-- targetNamespace和xmlns:tns是一致的,什么意思呢,就是说在本页面如果要引用本页面的一些资源,就要加入tns这个前缀才能引用,不然就是引用默认命名空间xmlns的资源 -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/persion"
        xmlns:tns="http://www.example.org/persion" elementFormDefault="qualified">
    
        <element name="persion">
            <complexType>
                <sequence>
                    <element name="id" type="int"></element>
                    <element name="username" type="string"></element>
                    <element name="time" type="date"></element>
                </sequence>
            </complexType>
        </element>
    </schema>
    <?xml version="1.0" encoding="UTF-8"?>
    <persion xmlns="http://www.example.org/persion" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.example.org/persion">
    
        <id>1</id>
        <username>sfz</username>
        <time>1992-01-12</time>
        
    </persion>
  • 相关阅读:
    httpsqs消息队列
    Memcache 配置和使用
    nyist 68三点顺序
    nyist 67三角形面积
    rwkj 1363 正方形 长方形 三角形面积
    rwkj 1359 友元:两点距离
    rwkj 1357 矩形--面积-周长
    rwkj 1356 点与矩形
    rwkj 1354 圆周长与面积
    rwkj 1327 圆柱体体积
  • 原文地址:https://www.cnblogs.com/songfahzun/p/5888440.html
Copyright © 2011-2022 走看看