> From: Mingyu Ma
 > Sent: Thursday, November 24, 2011 3:58 AM
 > 
> I have read your website about generateDS. It is super work. Now I
> have a question about it. Could you please tell me if there are some
> code to support the "xs:key" and "xs:keyref", where can I find them
> or should I write them myself?

No. generateDS.py does not do anything to support xs:key and
xs:keyref.  I did a quick search on the Web and read just a little
about them. But I admit that I don't know what generateDS.py should
generate for those two (xs:key and xs:keyref) and for the
xs:selector and xs:field elements that they contain.

I found one document on the Web that said that xs:key and xs:keyref
enforce a restriction (an integrity constraint) on the instance
document.  I believe that is what "XML Schema Part 0: Primer Second
Edition" says, too.  If that is all that xs:key and xs:keyref do,
then perhaps generateDS.py does not need to do anything additional.

Perhaps one way to satisfy your need is to send your XML instance
documents through a tool that validates the document against a
schema, for example xmllint. I don't know whether xmllint enforces
that particular constraint, but perhaps one of the validators
mentioned here does: http://en.wikipedia.org/wiki/XML_validation

Is my understanding of xs:key and xs:keyref, as simple minded as it
is, correct?  Or, is there more in the way of support that you need.

And, don't forget, Lxml does XML validation.  So you could even
build that validation into your Python code, whether or not you use
data bindings (classes) generated with generateDS.py.

Hope this helps.

- Dave


 
-- 


Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to