Newbie: Schema to XML to Schema
This should cover W3C XML Schema, Relax NG and DTD related problems.
Newbie: Schema to XML to Schema
Hi,
I have created TEMPLATE.XSD for designing environmental surveys. The survey is made up of questions that are categorised via a hierarchy of criteria.
The three element types are:
<template> the top-level container,
<classify> a node for classifying the questions, nested to some arbitrary depth,
<evaluate> a node for the question, the data format of the answer, and how it can be obtained (eg. calculation, scientific model...) For example:
<template>
<classify level="1">
<title>Atmosphere</title>
<classify level="2">
<title>Composition</title>
<classify level="3">
<title>Inputs</title>
<evaluate>
<title>PM10 emission</title>
<author>Me</author>
<quantitative>
<units>g/km</units>
<method>simulator</method>
<tool>LCA_ware</tool>
</quantitative>
</evaluate>
</classify>
From TEMPLATE.XSD the next step is to create TEMPLATE.XML — the schema/design for the survey details (the actual questions grouped by nested criteria, and the elements+format for each response).
What I can't work out is how to generate SURVEY.XSD from the content of TEMPLATE.XML (via an XSLT, but that's not the problem part). SURVEY.XSD is the schema for SURVEY.XML which will contain the responses collected each time the survey is conducted. There needs to be one and only one answer to each question specified in TEMPLATE.XML.
<assessments>
<assessment>
<classify level="1" title="Atmosphere">
<classify level="2" title="Composition">
<classify level="3" title="Emissions">
<evaluate title="PM10">
<author>Me</author>
<result type="quantitative">
<value>1.5</value>
<range>
<upper>1.8</upper>
<lower>1.2</lower>
</range>
<inputs>http://www.mysite.com/Test1/q1.1.1_inputs.htm</inputs>
<outputs> ...free-form content in here for key outputs... </outputs>
<networkDiagram>http://www.somelinktoresult...</networkDiagram>
<error>Low</error>
...
</assessment>
<assessment id="2">
...
</assessment>
</assessments>
I feel that I'm probably well wide of the mark. My other idea is that the second XML document, SURVEY.XML, contains only <assessment> and <evaluation> elements, and each <evaluation> element uses key and/or keyref to link to the corresponding <evaluation> in TEMPLATE.XML.
Any thoughts gratefully received,
Michael
I have created TEMPLATE.XSD for designing environmental surveys. The survey is made up of questions that are categorised via a hierarchy of criteria.
The three element types are:
<template> the top-level container,
<classify> a node for classifying the questions, nested to some arbitrary depth,
<evaluate> a node for the question, the data format of the answer, and how it can be obtained (eg. calculation, scientific model...) For example:
<template>
<classify level="1">
<title>Atmosphere</title>
<classify level="2">
<title>Composition</title>
<classify level="3">
<title>Inputs</title>
<evaluate>
<title>PM10 emission</title>
<author>Me</author>
<quantitative>
<units>g/km</units>
<method>simulator</method>
<tool>LCA_ware</tool>
</quantitative>
</evaluate>
</classify>
From TEMPLATE.XSD the next step is to create TEMPLATE.XML — the schema/design for the survey details (the actual questions grouped by nested criteria, and the elements+format for each response).
What I can't work out is how to generate SURVEY.XSD from the content of TEMPLATE.XML (via an XSLT, but that's not the problem part). SURVEY.XSD is the schema for SURVEY.XML which will contain the responses collected each time the survey is conducted. There needs to be one and only one answer to each question specified in TEMPLATE.XML.
<assessments>
<assessment>
<classify level="1" title="Atmosphere">
<classify level="2" title="Composition">
<classify level="3" title="Emissions">
<evaluate title="PM10">
<author>Me</author>
<result type="quantitative">
<value>1.5</value>
<range>
<upper>1.8</upper>
<lower>1.2</lower>
</range>
<inputs>http://www.mysite.com/Test1/q1.1.1_inputs.htm</inputs>
<outputs> ...free-form content in here for key outputs... </outputs>
<networkDiagram>http://www.somelinktoresult...</networkDiagram>
<error>Low</error>
...
</assessment>
<assessment id="2">
...
</assessment>
</assessments>
I feel that I'm probably well wide of the mark. My other idea is that the second XML document, SURVEY.XML, contains only <assessment> and <evaluation> elements, and each <evaluation> element uses key and/or keyref to link to the corresponding <evaluation> in TEMPLATE.XML.
Any thoughts gratefully received,
Michael
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service