
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.
A second problem I encountered while debugging the above is that this definition:
NiceString ::= TEXTUAL-CONVENTION DISPLAY-HINT "1d1d" STATUS current DESCRIPTION "doc" SYNTAX OCTET STRING (SIZE (2 | 2))
causes smidump to hang. In practice this is not a problem - just fix the SIZE specification in the MIB file.