복합 유형에서 단순 유형 컨텐츠 확장
스키마 및 XML 문서에서 단순 유형 컨텐츠를 확장할 수 있습니다.
다음 예제에서는 string 유형의 unit 속성을 포함하도록 기본 유형 int의 temperature를 확장합니다.
스키마는 다음과 같습니다.
<complexType temperature>
<simpleContent>
<extension base="int">
<attribute name="unit" type="string"/>
</extension>
</simpleContent>
</complexType>
다음은 XML 문서에서 발췌한 것입니다.
<temperature unit= "celsius">15</temperature>
XOM 표시는 다음과 같습니다.
Class Temperature extends IlrXmlObject
{
int content ;
String unit ;
…
}