Ryku,
I've made some progress on one of the issues that you reported. See
below.
On Tue, Mar 22, 2016 at 11:56:50PM +0100, Test User wrote:
> Thank You for reply.
> I've got sample schema that i think may be
> helpful:Â [1]https://github.com/ryku123/xsd_cutted_gends/blob/master/xs
> d/pain_cutted.xsd
> And by the way my tryouts
> here:Â [2]https://github.com/ryku123/xsd_cutted_gends
> Best regards,
> Ryku
>
> 2016-03-22 23:51 GMT+01:00 Dave Kuhlman <[3]dkuhl...@davekuhlman.org>:
>
> >
> > Hi Dave,
> >
> > I would like to build XML's on the base of given schema (using all
> validation rules that this xsd provides) then add some custom rules
> for certain tags etc..
> > My demo project is here:
> [4]https://github.com/ryku123/xsd_playground
> Ryku,
> Thank you for your report.
> I'm trying to work through your issues.
> I'm creating a small test schema so as to try to reproduce the
> errors you have reported.
> First, I'm trying to reproduce the following error:
> > Some tags (a lot) are mapped into somethign like this (None
> objects):
> >
> >Â def buildChildren(self, child_, node, nodeName_,
> fromsubclass_=False):
> >Â Â Â Â Â if nodeName_ == 'Nm':
> >Â Â Â Â Â Â Â obj_ = None
> >Â Â Â Â Â Â Â self.Nm = obj_
> >Â Â Â Â Â Â Â obj_.original_tagname_ = 'Nm'
> >Â Â Â Â Â Â Â # validate type Max70Text
> >Â Â Â Â Â Â Â self.validate_Max70Text(self.Nm)
> >
> > I have a really hard time figuring out how to make them for
> > example to be treated as string by default or to apply any other
> > workaround that will keep validation rules from xsd as well.
> You are right, I believe. The generated line above that reads
> "obj_ = None" is wrong. I'm guessing that it should be something
> like
> "Nm_ = child_.text".
> I'll keep working to figure out what is the difference between my
> test schema and your schema and why generateDS.py is producing that
> bad code. My test schema is producing the correct code, whereas
> when I use your schema, it produces erroneous code similar to what
> you have reported.
> I'll keep working to figure out what is making the difference.
> Thank you for providing your schemas. That has and will be very
> helpful.
> I'll report back when I find something.
> Dave
I believe that I've fixed the above issue. The problem was caused in
generateDS.py when it saved a xs:simpleType restriction base name
that contained a dash ("-"). It should have converted the dash to
an underscore. Now it does.
I've attached a patch, based on gDS version 2.20a, in case you want
to try it out.
Thank you for providing those additional schemas. They helped me
identify the cause of this problem.
I'll try to spend some time on your other issues, tomorrow.
Dave
--
Dave Kuhlman
http://www.davekuhlman.org
diff -r 8cfd599f6c20 generateDS.py
--- a/generateDS.py Fri Feb 26 08:58:56 2016 -0800
+++ b/generateDS.py Wed Mar 23 15:34:14 2016 -0700
@@ -1732,7 +1732,10 @@
# the restriction base.
if ((self.inSimpleType >= 1 or self.inSimpleContent) and
'base' in attrs):
- self.stack[-1].setBase(attrs['base'])
+ baseName = attrs['base']
+ if not is_builtin_simple_type(baseName):
+ baseName = cleanupName(strip_namespace(baseName))
+ self.stack[-1].setBase(baseName)
else:
if 'base' in attrs:
self.stack[-1].setRestrictionBase(attrs['base'])
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users