2010-07-05 2 views
0

현재 작업하고있는 일부 XML의 유효성을 검사하기 위해 XSD를 구축 중입니다.이 작업을 수행 할 수 없다고 추측합니다.하지만이를 적용 할 수있는 방법이 있는지 궁금합니다. 속성은 ";" 구분 된 목록 예 :세미콜론으로 구분 된 xs : attribute xsd

<nbsp style="cell-width:1.29;background-color:#99CC00;"/> 

html로 스타일 속성이 작동하는 방식과 비슷합니다. 당신은 특정 pattern 일치해야 유형을 지정할 수 있습니다 사전

답변

1

감사합니다.

예 :

<simpleType name='better-us-zipcode'> 
    <restriction base='string'> 
    <pattern value='[0-9]{5}(-[0-9]{4})?'/> 
    </restriction> 
</simpleType> 
+0

감사합니다, 나는이 알고 있어요하지만 의도는 몇 가지를 얻을 수 있습니다 가능한 경우 상황에 맞는 도움말 –

1

콘텐츠의 유효성을 검사하는 정규 표현식을 사용합니다.

<xs:attribute name="code"> 

<xs:simpleType> 
    <xs:restriction base="xs:string"> 
    <xs:pattern value="[A-Z][A-Z]"/> 
    </xs:restriction> 
</xs:simpleType> 

</xs:attribute> 

도 볼

http://www.w3schools.com/Schema/el_attribute.asphttp://www.w3schools.com/schema/schema_simple_attributes.asp 하고 정규 표현식 여기 http://www.w3schools.com/schema/schema_facets.asp

시험 : http://regexlib.com/RETester.aspx

관련 문제