views:

125

answers:

5

I am not sure if this makes sense so apologies before hand: is there a markup language specifically for creating document specifications? For example, if instead of giving people a template Word document for a given document they need to create, supply them with the specification in the markup language on what the document has to contain and how it should be structured. I am thinking this could be possible just by using XML but I wanted to know if there is something smarter that this:

<document>
 <chapter number="1" title="Introduction">
 <description>A short introduction about yourself</description>
</chapter>
...
</document>

Thank you

edit:

Thank you for the replies. I think the above example is best said with an example. In order to release data to a third party in my organization, they need to fill out a security policy which contains some information on how they will make sure the data is kept safe on their end. In the majority of cases, people will download the Word template for it, fill it out and send it back. I want to create a formal specification of what that document should contain, in a markup language, so people can potentially build tools or other things around the creation of the document.

I realized that the example above was wrong, its a specification so should not contain any actual "contents" of the document.

A: 

It's somehow related: the new Office 2007 file format is XML based: Introducing the Office (2007) Open XML File Formats

I never came across a XML format like you described, but it's possible to build one; probably your main problem will be enforce enterprise usage.

Rubens Farias
A: 

DTD or XML Schema

Tamás Szelei
@sztomi both your links point to the XML/Schema page
Aviral Dasgupta
Thanks, fixed it.
Tamás Szelei
DTD is not a markup langauge. XSD Schema is only used for describing other matkup languages
peter.murray.rust
s/matkup/markup
peter.murray.rust
You are right about the DTD but I suggested XML Schema before the OP clarified his question.
Tamás Szelei
+2  A: 

What you've shown as a snippet is almost precisely the DocBook XML markup.

It works quite well. The problem is that it's XML and painful to edit. There are nice editors for this, however. I used XMLMind XML Editor.

However, you'd be much, much happier using ReStructured Text and the Python-based Docutils for this kind of thing.

RST is much, much easier to learn and edit than any other markup language.

S.Lott
Agreed. We switched our docs (http://phpcompiler.org/doc/latest/manual.html) to docbook from latex, only to find it more of a hassle to add to them. We switched again to RST, and it made updating them painless, so that we actually wrote more docs.
Paul Biggar
A: 

It is one thing to create a format and to stipulate that, in order for a document to be valid, certain fields must be non-empty. It is another to verify that a particular document complies with that stipulation.

The first may be implemented as a word doc, or with some of the XML solutions described here. The second, though, is a matter of software. For a short form, perhaps an HTML form with client-side or server-side validation would be suitable. For a long one, perhaps file upload with server-side validation would work.

It sounds like the form of the required data structures is already defined in the word docs. How do you intend to enforce the submission of valid data?

Ewan Todd
A: 

Docbook if you want an XML solution. The good news is that there is a large community and many tools and examples. It's effectively a standard so that you can send such documents anywhere and expect people to be able to process. However it can be quite complicated.

peter.murray.rust