Custom XML <--> Writer (with rules enforced while editing)
Posted: Sat Aug 01, 2015 4:58 pm
I have a custom XML format. Let's say it's a set of recipes. Those recipes have ingredients and preparation steps. Ingredients are listed at the top, and steps come after. I don't want to use an XML editor to manipulate the data, since I want users not to see the XML but to use a word processor's spell check, etc. I don't want users to have to do an extra step to convert the .odt file to the XML or vice-versa (they're not technical or can't be bothered). I also want the editor to enforce rules about the data, e.g., ingredients come first, preparation steps next, a recipe needs at least one ingredient and one step, etc.
There are products that do this, namely Xopus (which does it in a web page) - it's far from free (even though it started as an open-source project). Microsoft also has InfoPath (which seems to be exactly what I'm looking for). It was announced as discontinued in 2014. I'd like to make my solution open source and Googling pointed me several times to OO because of its XML filters.
XML import/export seems feasible with OO XML filters. However, I know that word processors like MSWord don't prevent or enforce semantics (the way paragraph styles can be used within a document). For example, users can insert an ingredient in the middle of the preparation steps, or make a recipe without ingredients, etc. In XML, these data rules are often specified in a schema (XSD). Xopus and InfoPath (mentioned above) work from an XSD file, but I'm not asking for a solution in OO that supports arbitrary XSD's (it's a really hard problem). The format of my data is fairly simple, but there are some rules about how the data are nested and structured and I'd like the editor to enforce them.
Here are some specific questions:
There are products that do this, namely Xopus (which does it in a web page) - it's far from free (even though it started as an open-source project). Microsoft also has InfoPath (which seems to be exactly what I'm looking for). It was announced as discontinued in 2014. I'd like to make my solution open source and Googling pointed me several times to OO because of its XML filters.
XML import/export seems feasible with OO XML filters. However, I know that word processors like MSWord don't prevent or enforce semantics (the way paragraph styles can be used within a document). For example, users can insert an ingredient in the middle of the preparation steps, or make a recipe without ingredients, etc. In XML, these data rules are often specified in a schema (XSD). Xopus and InfoPath (mentioned above) work from an XSD file, but I'm not asking for a solution in OO that supports arbitrary XSD's (it's a really hard problem). The format of my data is fairly simple, but there are some rules about how the data are nested and structured and I'd like the editor to enforce them.
Here are some specific questions:
- I read the XML Filters tutorial, but will OO writer enforce the rules?
- I read some about XForms in OO, which might be the answer about rules. However, If I use them, it's not clear to me if:
- there can be an arbitrary numbers of things (e.g. ingredients, steps)
- there can be an arbitrary numbers of recipes (I got the impression a form would be limited to a single entry)
- data inside the fields can be rich text that translates to CDATA HTML, e.g., bold, italics, and/or use of images inside ingredients or steps.