On Thu, Aug 18, 2016 at 01:38:45PM -0500, Han Loo wrote:
> Dave -
> 
> I hope you enjoyed your vacation.
> 
> I've run the validation of each file from the 3.5 interpreter as you
> previously advised but did not encounter any errors:
> 
> [image: Inline image 1]
> 
> I have attached the problematic schema to this response - it's still
> completely possible I'm doing something wrong, apologies in advance if it
> is something dumb, let me know if you encounter the same error (as in my
> initial email) when you get a chance to test.

Han,

Could there be an error in your command line when running
generateDS.py.  See examples below.
 
Otherwise, I'm stumped.  When I run the following command:

    $ ./generateDS.py -f -o tmp01sup.py -s tmp01sub.py --super tmp01sup 
--member-specs=dict --export=write Report.xsd

generateDS.py successfully generates modules.

./generateDS.py, by the way, is a symbolic link to where I have
generateDS.py installed.

And, this simpler command produced a module also:

    $ ./generateDS.py -o tmp1.py Report.xsd

I'll try it with Python 3.5.

That seemed to work, also.

What platform are you on?  Could it be some kind of big-endian vs.
little-endian issue?  Or, maybe a line ending (Linux vs. MS Windows)
thing?  I don't think it is, but I can't think of anything else.

In my test, both Report.xsd and ReportEnumerations.xsd are in the
directory in which I run generateDS.py, although I believe that you
can have them in a different directory, as long as they are both in
the same directory.

Yes, I just checked, and that's true.  So the following worked also:

    $ python3.5 ./generateDS.py -f -o tmp01sup.py -s tmp01sub.py --super 
tmp01sup --member-specs=dict --export=write Schemas/Report.xsd

I'm on Linux.  I'm using generateDS.py version 2.22b.  It looks like
I'm using Lxml v. 3.6.1.  In the IPython interactive shell:

    In [1]: from lxml import etree
    In [2]: etree.__version__
          Out[2]: u'3.6.1'

If none of the above commands work for you, then I don't know what
to suggest.

Dave
 
> Thanks!
> Han
> 
> On Tue, Aug 9, 2016 at 10:31 AM, Han Loo <monikersupr...@gmail.com> wrote:
> 
> > Thanks for your response. I will run a validation check on both .xsd files
> > and see what I come up with.
> >
> > On Mon, Aug 8, 2016 at 12:33 AM, Dave Kuhlman <dkuhl...@davekuhlman.org>
> > wrote:
> >
> >> On Mon, Aug 08, 2016 at 12:39:46AM +0000, generateds-users-owner@lists.s
> >> ourceforge.net wrote:
> >> > From: Han Loo <monikersupr...@gmail.com>
> >> > Date: Sun, 7 Aug 2016 19:39:38 -0500
> >> > Subject: Parse Error: lxml.etree.XMLSyntaxError: Start tag expected, '<'
> >> >  not found, line 1, column 1
> >> > To: generateds-users@lists.sourceforge.net
> >> >
> >> >    Apologies in advance for what I'm sure will end up being a simple
> >> >    obvious-in-hindsight question - my only real excuse is that I'm
> >> rather
> >> >    new to all of this having been a C++ programmer on the embedded side
> >> in
> >> >    my last incarnation.Â
> >> >    I'm attempting to generate a set of .py classes from a pair of schema
> >> >    files "Report.xsd" and "ReportEnumerations.xsd"
> >> >    Traceback (most recent call last):
> >> >    Â  File "generateDS-2.22a0\generateds.py", line 7082, in <module>
> >> >    Â  Â  main()
> >> >    Â  File "generateDS-2.22a0\generateds.py", line 7070, in main
> >> >    Â  Â  processIncludes, options, args, superModule=superModule)
> >> >    Â  File "generateDS-2.22a0\generateds.py", line 6622, in
> >> >    parseAndGenerate
> >> >    (src\lxml\lxml.etree.c:104977)
> >>
> >> [snip]
> >>
> >> >    Â  File "parser.pxi", line 613, in lxml.etree._raiseParseError
> >> >    (src\lxml\lxml.etree.c:103886)
> >> >    lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1,
> >> >    column 1
> >> >    Report.xsd includes the latter enumerations:
> >> >    Â  <xs:include schemaLocation="ReportEnumerations.xsd" />
> >> >    Could this be the root of the problem?
> >> >    I've played around with the file locations with respect to the paths
> >> >    but no luck.
> >> >    Any advice would be much appreciated.
> >> >    Thanks!
> >>
> >> Hello,
> >>
> >> It looks like lxml, which is used by generateDS.py to parse the XML
> >> schema file, is saying that Report.xsd or perhaps some file included
> >> by it, is not well formed.
> >>
> >> Try this at the Python interactive prompt:
> >>
> >>     >>> from lxml import etree
> >>     >>> doc = etree.parse("Report.xsd")
> >>
> >> If that fails, it means that something is wrong with Report.xsd.  If
> >> it succeeds, try doing the same thing with ReportEnumerations.xsd,
> >> etc.  generateDS.py (and lxml) cannot do anything with an XML file
> >> that is not well formed.  So, the above should help you track down the
> >> error and, hopefully, fix it.
> >>
> >> I'm leaving on vacation tomorrow for about 4 days, and won't be able
> >> to do much about this until I return.
> >>
> >> If you are still having this problem, you might send Report.xsd to
> >> me so that I can try it myself.
> >>
> >> Dave
> >>
> >>
> >>
> >> --
> >>
> >> Dave Kuhlman
> >> http://www.davekuhlman.org
> >>
> >
> >



-- 

Dave Kuhlman
http://www.davekuhlman.org

------------------------------------------------------------------------------
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to