Bernd,
I appreciate the comments. And, thank you for your detailed report.
I apologize for not working on this yet. I've been working on some
other generateDS.py issues. I'll put this on the top of my stack
for Monday.
Hope your weekend is a good one.
Dave
On Thu, Jul 19, 2018 at 12:19:52PM +0000, Zimmermann, Bernd wrote:
> Hello Dave,
>
> very great stuff you've done with generateDS, works like a charm but only
> after a resolving a few little things.
>
> First on, this might be a bug:
>
> XSD Pattern:
>
> <xsd:simpleType name="GeneralizedTime">
> <xsd:restriction base="xsd:string">
> <xsd:pattern
> value="\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])(.[0-9][0-9]*)?(Z|[\+|\-][0-9]{4})"/>
> </xsd:restriction>
> </xsd:simpleType>
>
> results in:
>
>
> validate_GeneralizedTime_patterns_ =
> [['^\\d{4}(0[1-9]$|^1[012])(0[1-9]$|^[12][0-9]$|^3[01])([01][0-9]$|^2[0-3])([0-5][0-9])([0-5][0-9])(.[0-9][0-9]*)?(Z$|^[\\+$|^\\-][0-9]{4})$']]
>
> which give the warning:
>
>
> /var/etsi/work/V1.18.1/Natparas2V18.py:7644: UserWarning: Value
> "b'20180719123801+0200'" does not match xsd pattern
> restrictions:
> [['^\\d{4}(0[1-9]$|^1[012])(0[1-9]$|^[12][0-9]$|^3[01])([01][0-9]$|^2[0-3])([0-5][0-9])([0-5][0-9])(.[0-9][0-9]*)?(Z$|^[\\+$|^\\-][0-9]{4})$']]
> warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' %
> (value.encode('utf-8'), self.validate_GeneralizedTime_patterns_, ))
>
> Adjusting to:
>
>
> validate_GeneralizedTime_patterns_ =
> [['^\\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9])([0-5][0-9])(.[0-9][0-9]*)?(Z|[\\+|\\-][0-9]{4})$']]
>
> gives no warning.
>
> So it might be a problem with the separator | which results in a wrong ^|$
> pattern?
>
>
> Second one, discovering a problem with:
>
> testxml.export(sys.stdout, 0, '', 'retainedDataMessage')
> at:
> outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' +
> namespacedef_ or '', ))
>
> This works correct, printing out <retainedDataMessage> or with a
> generatednamespaces.py with GenerateDSNamespaceDefs the <retainedDataMessage
> NSGIVEN>
>
> But:
>
> testxml.export(sys.stdout, 0, 'NSDATA', 'retainedDataMessage')
>
> gives: <NSDATAretainedDataMessage> which is not correct, it should be
> <retainedDataMessage NSDATA>,
> so it's printed in the wrong order and a space is missing between the two
> arguments.
>
> Perhaps a:
> outfile.write('<%s%s%s' % (name_, namespace_ and ' ' + namespace_ or '',
> namespacedef_ and ' ' + namespacedef_ or '', ))
>
> could fix this. Note: the closing tag must be adjusted too.
>
> Perhaps the export could also be adjusted to overwrite the namespacedef_ if a
> namespace_ is given or vice versa ...
>
> I am using the latest version 2.29.17 installed via pip under Python 3.7
>
> Hope you could fix it.
>
> Again, great work!
>
> Best regards,
> Bernd
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> generateds-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/generateds-users
--
Dave Kuhlman
http://www.davekuhlman.org
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
generateds-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/generateds-users