-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for schema (Redux mk. II) #438
base: master
Are you sure you want to change the base?
Conversation
currently matches getting-things-gnome#279. mostly (still in discussion re: CDATA vs. escaping in <content>). all uniqueness and associations applied, i think, as well.
@diegogangl the schemas should now match the current proposed format for #279, with the EXCEPTION of still hashing out how to handle if you'd like to validate yourself, you can do it without lxml- just make sure libxml2 is installed (which it almost assuredly is if you're using lxml), and do: cd /tmp
git clone --single-branch --branch schema https://github.com/johnnybubonic/gtg.git r00t_gtg
cd r00t_gtg/data/schema
xmllint --noout --schema data.xsd /path/to/your/proposed/format.xml The validation errors can be a little confusing, but they're pretty easily googled. If you get any, let me know. The only one I think you'll get is it choking on
Note that you need to change your closing tags in You may need to enable the default namespace (per the snippet in comment 0 of this PR). |
A couple of things to change here:
I can send you a |
@diegogangl yeah, please send an updated |
And of course I never sent you an updated xml -_- Here it is: |
NOTE: This is a total redo of #431 (and #437, oops - need to stop playing with branches I have open PRs for) to match the updated example in #279 as it progresses.
Hey all! I'm composing some XSDs for GTG.
Why?
This, combined with the porting to LXML (#401) (LXML natively supports XSD), will let you do some REALLY nice things programmatically:
Review
I'd like someone more familiar with the GTG guts to give it a look over. Please review and reference the items marked:
for specific questions/concerns/suggestions I have.
Outer scope changes
The
gtg_tasks.xml
(filename subject to change per #279 approval/implementation), etc. will need to have namespaces added.e.g. for
gtg_tasks.xml
, instead of:it'd be:
This can be done programmatically, and I can provide code to convert existing documents over to the namespaced version.
Implementation
I can provide examples of how to automatically detect, parse, fetch, and validate XSDs (and strip the namespace once the data/structure is validated/verified and defaults are applied, so the elements don't need to be referenced by namespace) with lxml, as I have direct experience with lxml in python3 and the above.
Further Reading
It is recommended to review #279 in full and take note of the example proposed document format. This PR will attempt to stay in tandem with current proposed format per #279, and will exit draft stage and enter a review/pulling stage once the specification in #279 hits master.