在XSD中表示2D字符
我是XSD的新手。我有一个需要在XSD中表示的结构:在XSD中表示2D字符,xsd,Xsd,我是XSD的新手。我有一个需要在XSD中表示的结构: struct { int num; char token[10] char value[20][10]; } test; 我如何在XSD中提到“值”?我可以将其他元素表示为: <complexType name=test> <sequence> <element name='num' type='int'/> <element name='token' type=
struct
{
int num;
char token[10]
char value[20][10];
} test;
我如何在XSD中提到“值”?我可以将其他元素表示为:
<complexType name=test>
<sequence>
<element name='num' type='int'/>
<element name='token' type='string' minOccurs='0' maxOccurs='unbounded'/>
</sequence>
</complexType>
此XSD将用于生成C++代码
谢谢以下模式描述了您的数据,生成了相当简洁的XML
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid Studio 2019 (https://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element name="num" type="xs:int" />
<xs:element name="token" type="ListOf10Chars" />
<xs:element name="value" type="ListOf10Chars" minOccurs="20" maxOccurs="20" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="CharType">
<xs:restriction base="xs:string">
<xs:length value="1" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ListChars">
<xs:list itemType="CharType" />
</xs:simpleType>
<xs:simpleType name="ListOf10Chars">
<xs:restriction base="ListChars">
<xs:minLength value="10" />
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
3281
A b c d e f g h i j
0 b c d e f g h i j
1 b c d e f g h i j
2 b c d e f g h i j
3 b c d e f g h i j
4 b c d e f g h i j
5 b c d e f g h i j
6b c d e f g h i j
7 b c d e f g h i j
8 b c d e f g h i j
9 b c d e f g h i j
0 b c d e f g h i j
1 b c d e f g h i j
2 b c d e f g h i j
3 b c d e f g h i j
4 b c d e f g h i j
5 b c d e f g h i j
6b c d e f g h i j
7 b c d e f g h i j
8 b c d e f g h i j
9 b c d e f g h i j
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2019 (https://www.liquid-technologies.com) -->
<test>
<num>3281</num>
<token>A b c d e f g h i j</token>
<value>0 b c d e f g h i j</value>
<value>1 b c d e f g h i j</value>
<value>2 b c d e f g h i j</value>
<value>3 b c d e f g h i j</value>
<value>4 b c d e f g h i j</value>
<value>5 b c d e f g h i j</value>
<value>6 b c d e f g h i j</value>
<value>7 b c d e f g h i j</value>
<value>8 b c d e f g h i j</value>
<value>9 b c d e f g h i j</value>
<value>0 b c d e f g h i j</value>
<value>1 b c d e f g h i j</value>
<value>2 b c d e f g h i j</value>
<value>3 b c d e f g h i j</value>
<value>4 b c d e f g h i j</value>
<value>5 b c d e f g h i j</value>
<value>6 b c d e f g h i j</value>
<value>7 b c d e f g h i j</value>
<value>8 b c d e f g h i j</value>
<value>9 b c d e f g h i j</value>
</test>