Subject:x12 schemas Author:john gabriel Date:15 Sep 2007 03:42 AM
I noticed that the x12 schemas that the Stylus Studio tool creates from the document wizard is not printing min/max length information for some types. This affects numeric fields in particular. Although the numeric type is not a string, it should still be subject to min/max rules, as the specifications dictate.
Is there anyway to get it to produce a complete schema? I have tinkered with the settings, but I haven't found anything that will let me do this. Thank you!
We used to emit min/max but stopped for several reasons:
1. minLength and maxLength in X12 mean something different
than they do in XML Schema, because of rules regarding counting
the decimal and sign.
2. The schemas are designed primarily for use as a mapping
source or target, and not for validation. There is an option
on the EDI converter which checks for element length and
understands the exact rules of X12 or EDIFACT or whatever other
EDI dialect you are using.
3. We discovered some validators were not using the same
measurement as others. Some weren't collapsing whitespace but
were looking at the lexical space instead of the value space
for comparisons. So the min/max length turned out not to be
as useful as we had hoped as you reach the limits.
Subject:x12 schemas Author:john gabriel Date:15 Sep 2007 06:16 PM Originally Posted: 15 Sep 2007 06:14 PM
Thank you Tony. I was planning on using the schema files with a production program that uses xml files to validate the incoming edi/x12 files. The xml basically gets parsed by a perl program that uses that information to validate the document. We aren't going to use the validator that comes with it, as we already have a system up that does that. So in my particular case, the min/max is very useful.
I understand that the schemas arent meant to be used in the way I am planning on using them, but the files that the Stylus program makes are so much neater and cleaner than the ones we have now. It seemed a natural thing to try to use them for that purpose. I supposed I can manually enter the missing info I need, but that would be time consuming since we only have hardcopies of the x12 specs.
Since the software did at one time emit the min/max values, is there a way I can turn that on? Or is that now hardcoded into the program. Also, if there isn't a way for me to do so, do you think that maybe a future version will give the option?
Subject:x12 schemas Author:Tony Lavinio Date:17 Sep 2007 09:19 AM Originally Posted: 17 Sep 2007 09:18 AM
Would it help if I was able to produce an XML document that contained
a list of each element and its dictionary min and max widths?
Then you could keep that as a reference, and a fairly simple XSLT
program could add those to your XSD's in whatever form you feel would
be most helpful - either as pattern facets or as minLength/maxLength
or as a length facet.