I have a document that will constantly be updated and consists of text and tables. The tables have two rows, one which ranges of numbers and the second with a single number.
I would like to check if the number in row 2 is within the range given in row 1. I would like to do this using XMLs and XSDs. My original thought was to create an XSD from the word doc, then an XML from the word doc (save the file as a .xml) and then run both files through a vaidator. However, I am having trouble writing the XSD. A lot of sources online say to generate an XSD from and XML and use that XSD to validate the XML. But the problem is if I do this, I'm not seeing any ranges specified in the XSD. It just looks like doc formatting specifications. Does anyone know if there any tools to do this task or is this something where I need to generate the XSD manually. My ultimate goal is to automate the process such that given a doc, I have an XSD and can generate an XML, then I can just change values in the XML and see if it is in a valid range according to the XSD(which should check ranges). I am really stuck on how I can automate this process (or even if there is a way to automate it)
EDIT: This is actually how one can do restrictions with ranges in schema - <a href="http://www.w3schools.com/xml/schema_facets.asp" rel="nofollow">http://www.w3schools.com/xml/schema_facets.asp</a>Answer1:
<sup><sub><strong>Preface</strong>: Ken White is right when he <a href="https://stackoverflow.com/questions/37801066/xml-xsd-validation-for-a-word-doc#comment63067852_37801066" rel="nofollow">comments</a> that you should improve your existing question rather than re-ask it without substantial improvement. I'll place this answer here since this version of your question is slightly better than the other; please delete the other.</sub></sup>
Microsoft Word documents since Word 2007 are saved in a DOCX format that follows the <a href="http://www.ecma-international.org/publications/standards/Ecma-376.htm" rel="nofollow">Office Open XML</a> (OOXML) standard. Start by reading this <a href="http://www.ecma-international.org/news/TC45_current_work/OpenXML%20White%20Paper.pdf" rel="nofollow">Office Open XML Overview</a>. Knowing this, you'll then be able to construct some reasonable searches to find OOXML tutorials and code samples. Understand that this is not an easy first project in XML.<blockquote>
I would like to check if the number in row 2 is within the range given in row 1. I would like to do this using XMLs and XSDs.</blockquote>
XSDs are not appropriate here. XPath would be better suited for retrieving and checking values in this manner.<blockquote>
My ultimate goal is to automate the process such that given a doc, I have an XSD and can generate an XML, then I can just change values in the XML and see if it is in a valid range according to the XSD(which should check ranges).</blockquote>
Again, although there are XSDs for OOXML (the XML behind DOCX), they support extreme amounts of baggage unnecessary to your project. Look instead into streamlined access to the data you seek via XPath calls from the language of your choice. You'll have to understand the data model, so be sure to read the OOXML references mentioned above first.