开发者

xs:anyAttributes is rejecting an attribute

In my schema I have:

<xs:element name="html-script">
    <xs:annotation>
       <xs:documentation>Element used to specify pass-through Javascript</xs:documentation>
    </xs:annotation>
   <xs:complexType>
     <xs:simpleContent开发者_运维知识库>
       <xs:extension base="xs:string">
         <xs:anyAttribute/>
       </xs:extension>
     </xs:simpleContent>
  </xs:complexType>
</xs:element>

In a document I have:

<html-attributes target="_new"/>

When I validate, I get ...

Validation error: cvc-complex-type.3.2.2: Attribute 'target' is not allowed to appear in element 'html-attributes'. at file:/Users/benson/x/btweb/web_2_0/./content/about-us/about-us.xml line 35 character 38

What am I missing?


Possible Typo? Your schema defines the element <html-script> whereas your document uses <html-attributes>.

Also try adding the processContents directive to your anyAttribute:

<xs:anyAttribute processContents="skip" />

or

<xs:anyAttribute processContents="lax" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜