maven编译期间xsd验证失败

时间:2014-05-30 04:41:28

标签: xml validation maven xsd

我有一个xsd,其元素具有属性:

<xs:attribute name="sdk_version" use="required" >
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="(([0-9]{1,4}.[0-9]{1,4}))"/>
    </xs:restriction>
  </xs:simpleType>
</xs:attribute>

但是我的xml就像:

<?xml version="1.0" encoding="UTF-8"?>
  <service_description
    xmlns="http://archiveschemas.aus.x.com/aus"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://archiveschemas.aus.x.com/aus 
                        aus.xsd"
    name="${serviceName}" 
    version="${serviceVersion}"
    **sdk_version="${CE-SDK-Version}"** 
    sdk_build="${CE-SDK-Release}">
    <component type="properties" filename="properties.xml" />
    <component type="servlet" filename="testlog-ear-${project.version}.ear" />
 </service_description>

但是编译失败并出现错误:

  

无法执行目标org.codehaus.mojo:xml-maven-plugin:1.0:validate(默认)        在项目测试日志上:解析时        C:\ Assignment \ testlog \ testlog -svar \ src \ main \ resources \ manifest.xml,在
       文件:/ C:/Assignment/testlog/testlog-svar/src/main/resources/manifest.xml,        第6行,第67栏:cvc-pattern-valid:价值&#39; $ {CE-SDK-Version}&#39;        对于模式而言,这并不是一个有效的问题&#39;(([0-9] {1,4}。[0-9] {1,4}))&#39;        对于类型&#39;#AnonType_sdk_versionservice_description&#39;。 - &GT; [帮助1]        [错误]

我的pom.xml看起来像:

0 个答案:

没有答案