
Hi Arndt!
Sorry for the late reply.
Arndt Jonasson schrieb:
I use libsmi 0.4.5. When I have a textual convention like this one:
NiceString ::= TEXTUAL-CONVENTION DISPLAY-HINT "1d1d" STATUS current DESCRIPTION "doc" SYNTAX OCTET STRING (SIZE (2))
it gets translated by the -f xsd option into:
<xsd:simpleType name="NiceString"> xsd:annotation xsd:documentation doc </xsd:documentation> xsd:appinfo <displayHint>1d1d</displayHint> <lengths> <length min="2" max="2"/> </lengths> </xsd:appinfo> </xsd:annotation> <xsd:restriction base="xsd:string"> <xsd:pattern value="((0|[1-9](([0-9]){0,2}))((0|[1-9](([0-9]){0,2})))"/> </xsd:restriction> </xsd:simpleType>
Note here that the pattern is malformed: the first opening parenthesis is not closed. The code in getStrDHType which is responsible I find somewhat complicated, but my current fix is to change the line
smiAsprintf( &ret, "%s)", ret );
to smiAsprintf( &ret, "%s))", ret );
This is line 585; the header has
- @(#) $Id: dump-xsd.c 2609 2005-07-12 07:44:57Z strauss $
This fix may be in the wrong place, though.
Thanks for pointing this out. Yes, the code is very complicated. I have added a check for unclosed parenthesis at the end of the method. I am aware that this is only a quick-fix which will probably not help in all possible cases.
Best regards, Torsten