13.4.1 実行例1
- 〈この項の構成〉
(1) 入力
JSON形式データ
{
"Image":{
"Width":800,
"Height":600,
"Title":"View from 15th Floor",
"Thumbnail":{
"Url":"http://www.example.com/image/481989943",
"Height":125,
"Width":100
},
"Animated":false,
"IDs":[116,943,234,38793]
}
}
(2) コマンドの実行結果
cscjson2xsdコマンドの実行結果
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"elementFormDefault="qualified">
<xs:element name="csc-object">
<xs:complexType>
<xs:sequence>
<xs:element ref="Image"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Image">
<xs:complexType>
<xs:sequence>
<xs:element ref="Animated"/>
<xs:element ref="Height"/>
<xs:element ref="IDs"/>
<xs:element ref="Thumbnail"/>
<xs:element ref="Title"/>
<xs:element ref="Width"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Animated" type="xs:boolean"/>
<xs:element name="IDs">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="csc-element_IDs"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="csc-element_IDs">
<xs:complexType>
<xs:sequence>
<xs:element ref="csc-simple"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="csc-simple" type="xs:integer"/>
<xs:element name="Thumbnail">
<xs:complexType>
<xs:sequence>
<xs:element ref="Height"/>
<xs:element ref="Url"/>
<xs:element ref="Width"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Url" type="xs:anyURI"/>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Height" type="xs:integer"/>
<xs:element name="Width" type="xs:integer"/>
</xs:schema>cscjsonxmlconvコマンドの実行結果
<?xml version="1.0" encoding="UTF-8"?>
<csc-object>
<Image>
<Animated>false</Animated>
<Height>600</Height>
<IDs>
<csc-element_IDs>
<csc-simple>116</csc-simple>
</csc-element_IDs>
<csc-element_IDs>
<csc-simple>943</csc-simple>
</csc-element_IDs>
<csc-element_IDs>
<csc-simple>234</csc-simple>
</csc-element_IDs>
<csc-element_IDs>
<csc-simple>38793</csc-simple>
</csc-element_IDs>
</IDs>
<Thumbnail>
<Height>125</Height>
<Url>http://www.example.com/image/481989943</Url>
<Width>100</Width>
</Thumbnail>
<Title>View from 15th Floor</Title>
<Width>800</Width>
</Image>
</csc-object>