【问题标题】:regarding xsd schema defination of type attribute in response xml关于响应xml中类型属性的xsd模式定义
【发布时间】:2013-03-18 18:49:21
【问题描述】:

感谢您的宝贵时间,Java 新手,

 <address type="sponsor">
                <fullAdress>
                    <street>Blah blah</street>
                    <country>Blah blah</country>
                </fullAdress>
            </address>

这就是我的最终用户 xml,我对这里的属性类型有点困惑.. xsd 定义是什么?

【问题讨论】:

    标签: java xsd jax-ws


    【解决方案1】:

    从你问的情况来看,我的理解是你问的是你的属性的类型。我没有广泛使用 XSD,但这是我认为您正在寻找的东西。

    <xs:element name="fullAddress">
     <xs:complexType>
        <xs:sequence>
          <xs:element name="street" type="xs:string"/>
          <xs:element name="country" type="xs:string"/>
        </xs:sequence>
     </xs:complexType>
    </xs:element> 
    

    显然,就声明等而言,文件本身(这将是一个 sn-p)涉及更多设置。但正如你所见,我将街道和国家属性都指定为字符串类型。

    希望这会有所帮助。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-20
      • 1970-01-01
      • 2016-01-27
      • 1970-01-01
      • 1970-01-01
      • 2011-05-14
      • 2016-07-29
      相关资源
      最近更新 更多