How to use multiple schemas
The Blackbox can be configured for multiple schemas. If you already pass the schema name to Xeditor as a parameter, you only have to make sure to set the schema property in src/js.config/attributes.js
accordingly. Xeditor will then send the schema property along with every request. The Blackbox can then use this information to determine which schema to use for validation and which XSL files to use for transformation.
The Blackbox configuration would then look something like this:
schema: {
default: 'default@0.0',
'default@0.0': {
file: '#CONFIGPATH#/WEB-INF/xsd/content.xsd',
map: {
'mathml/mathml3.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3.xsd',
'mathml3-common.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-common.xsd',
'mathml3-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-content.xsd',
'mathml3-presentation.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-presentation.xsd',
'mathml3-strict-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-strict-content.xsd'
},
transformation: {
contenttoeditor: "#CONFIGPATH#/WEB-INF/xsl/contenttoeditor.xsl",
editortocontent: "#CONFIGPATH#/WEB-INF/xsl/editortocontent.xsl",
pastetoeditorfirst: "#CONFIGPATH#/WEB-INF/xsl/pastetoeditorfirst.xsl",
pastetoeditorsecond: "#CONFIGPATH#/WEB-INF/xsl/pastetoeditorsecond.xsl"
}
},
'schemaA': {
file: '#CONFIGPATH#/WEB-INF/xsd/schemaA.xsd',
map: {
'mathml/mathml3.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3.xsd',
'mathml3-common.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-common.xsd',
'mathml3-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-content.xsd',
'mathml3-presentation.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-presentation.xsd',
'mathml3-strict-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-strict-content.xsd'
},
transformation: {
contenttoeditor: "#CONFIGPATH#/WEB-INF/xsl/schemaA/contenttoeditor.xsl",
editortocontent: "#CONFIGPATH#/WEB-INF/xsl/schemaA/editortocontent.xsl",
pastetoeditorfirst: "#CONFIGPATH#/WEB-INF/xsl/schemaA/pastetoeditorfirst.xsl",
pastetoeditorsecond: "#CONFIGPATH#/WEB-INF/xsl/schemaA/pastetoeditorsecond.xsl"
}
},
'schemaB': {
file: '#CONFIGPATH#/WEB-INF/xsd/schemaB.xsd',
map: {
'mathml/mathml3.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3.xsd',
'mathml3-common.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-common.xsd',
'mathml3-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-content.xsd',
'mathml3-presentation.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-presentation.xsd',
'mathml3-strict-content.xsd': '#CONFIGPATH#/WEB-INF/xsd/mathml/mathml3-strict-content.xsd'
},
transformation: {
contenttoeditor: "#CONFIGPATH#/WEB-INF/xsl/schemaB/contenttoeditor.xsl",
editortocontent: "#CONFIGPATH#/WEB-INF/xsl/schemaB/editortocontent.xsl",
pastetoeditorfirst: "#CONFIGPATH#/WEB-INF/xsl/schemaB/pastetoeditorfirst.xsl",
pastetoeditorsecond: "#CONFIGPATH#/WEB-INF/xsl/schemaB/pastetoeditorsecond.xsl"
}
}
}