Laszlo,
Thank you for your report, for the example .xsd file, and for your
notes and guidance.
Give me a bit of time to look into this.
generateDS does not have a Github page. The source code repository
is at Bitbucket and uses Mecurial for its DRCS:
https://bitbucket.org/dkuhlman/generateds
More, soon, I hope.
Dave
On Sat, Jun 16, 2018 at 12:11:08PM +0200, Les wrote:
> Â Hello,
> Here are two more problems.
> #1 input encoding
> If you install generateDS on Windows + Python3.6, then it will use the
> default system encoding for opening XSD files. Even though the XSD file
> has this declaration in it:
> <?xml version="1.0" encoding="UTF-8"?>
> Also there is no option to specify the input encoding of the XSD files.
> But in most cases, the XML file will self-contain its encoding and it
> should be used.
> Here is an example traceback:
> c:\Python\Lib\kobak-lib>python -m generateDS --external-encoding utf-8 -o
> xsd/api.py -s xsd/apisubs.py xsd/invoiceApi.xsd
> Traceback (most recent call last):
> Â File "C:\Python\Python36-64\Lib\runpy.py", line 193, in
> _run_module_as_main
> Â Â Â "__main__", mod_spec)
> Â File "C:\Python\Python36-64\Lib\runpy.py", line 85, in _run_code
> Â Â Â exec(code, run_globals)
> Â File
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py",
> line 7473, in <module>
> Â Â Â main()
> Â File
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py",
> line 7455, in main
> Â Â Â superModule=superModule)
> Â File
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py",
> line 6925, in parseAndGenerate
> Â Â Â no_redefine_groups=noRedefineGroups,
> Â File
>
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\process_includes.py",
> line 88, in process_include_files
> Â Â Â doc, ns_dict = prep_schema_doc(infile, outfile, inpath, options)
> Â File
>
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\process_includes.py",
> line 322, in prep_schema_doc
> Â Â Â doc1 = etree.parse(infile)
> Â File "src\lxml\etree.pyx", line 3426, in lxml.etree.parse
> Â File "src\lxml\parser.pxi", line 1860, in lxml.etree._parseDocument
> Â File "src\lxml\parser.pxi", line 1880, in
> lxml.etree._parseFilelikeDocument
> Â File "src\lxml\parser.pxi", line 1775, in
> lxml.etree._parseDocFromFilelike
> Â File "src\lxml\parser.pxi", line 1186, in
> lxml.etree._BaseParser._parseDocFromFilelike
> Â File "src\lxml\parser.pxi", line 600, in
> lxml.etree._ParserContext._handleParseResultDoc
> Â File "src\lxml\parser.pxi", line 706, in lxml.etree._handleParseResult
> Â File "src\lxml\etree.pyx", line 316, in
> lxml.etree._ExceptionContext._raise_if_stored
> Â File "src\lxml\parser.pxi", line 370, in
> lxml.etree._FileReaderContext.copyToBuffer
> Â File
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\lib\encodings\cp1250.py",
> line 23, in decode
> Â Â Â return codecs.charmap_decode(input,self.errors,decoding_table)[0]
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position
> 5165: character maps to <undefined>
>
> c:\Python\Lib\kobak-lib>
>
> I have attached the example XSD. You must also know that I have a
> hungarian windows and its default encoding is cp1250. (But that should not
> matter because the input encoding is specified by the XSD file itself.)
> #2 output encoding
> On Python 3, we should not have an option to specify the output encoding.
> If you insist on keeping this switch, then it should default to UTF-8 and
> not the default system encoding. It is because Python 3 always uses
> UTF-8 source file encoding, no matter what.
> Does this project have a github page? It would be much better to track
> these in issues.
> Regards,
> Â Â Laszlo
>
> 2018-06-16 11:44 GMT+02:00 Les <[email protected]>:
>
> Â Hello!
> pipenv install generateDS
> pipenv shell
> python
> >>> import generateDS
> Traceback (most recent call last):
> Â File "<stdin>", line 1, in <module>
> Â File
> "C:\Users\User\.virtualenvs\kobak-lib-cw59HSqt\Scripts\generateDS.py",
> line 179, in <module>
> Â Â Â from six.moves import input
> ModuleNotFoundError: No module named 'six'
> It seems that generatedDS depends on six, but it is not added as a
> dependency.
> Cheers,
> Â Â Laszlo
--
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