XSD覆盖无效. [英] XSD Override not working.

查看:68
本文介绍了XSD覆盖无效.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在xsd中使用一个通用的xsd.

就像

I wanted to use a common xsd inside my xsd.

It is like

<xs:schema xmlns:child="http://kiran.com/childEntityXX">
    <xs:import namespace="http://kiran.com/common"    schemalocation="common.xsd">

      <xs:complexType name="childEntityXX">
        <xs:element name="XXX" type="child:EmpName">
      </xs:complexType>

      <xs:complexType name="EmpName">
        <xs:element name="myname" type="xs:string">
      </xs:complexType>



Common.xsd还包含复杂类型EmpName.

但是,当我的jaxb创建Java对象时,它是从Common Type引用EmpName而不是childEntityXX



Common.xsd also contains the complex type EmpName.

but, when my jaxb is creating the java objects, it is refering the EmpName from Common Type instead of the childEntityXX

推荐答案

.您需要使用xs:redefine元素.参见此教程 [
You need to use an xs:redefine element. See this tutorial[^] for details.


这篇关于XSD覆盖无效.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆