copybook from xml schema

103 views
Skip to first unread message

LegstarNewbie

unread,
Aug 20, 2009, 3:38:51 PM8/20/09
to legstar-user
Hi,

I have a xml schema which define simpleType restriction using facets

example.

<xsd:element name="ifFault" type="tns:IFException" />
<xsd:complexType name="Profile">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="id" type="tns:ID" />
</xsd:sequence>
</xsd:complexType>


<xsd:simpleType name="ID">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z0-9]{9}"/>
</xsd:restriction>
</xsd:simpleType>

In the generated copybook I see the following

01 COM-REPLY.
02 Profile.
03 name PIC X(32).
03 id PIC X(32).

I expected to get id as PIC X(9). Am I missing something?




Fady

unread,
Aug 23, 2009, 6:31:27 AM8/23/09
to legstar-user
You are correct, patterns are ignored by the complex types parser
right now.

It is not trivial to parse the pattern and infer a length from it in
the general case but it would certainly be a good thing to have.

Would you mind filing an enhancement request on http://code.google.com/p/legstar/issues/list
?

Thanks

Fady
Reply all
Reply to author
Forward
0 new messages