
Is there a way to have oXygen select different RELAX NG schemas depending on the version attribute of an XML document's root element? Also, why, if I make a document like the following, do I receive the error, "element "equation" from namespace "http://docbook.org/ns/docbook" not allowed in this context. Is it not allowed in the schema? <?xml version="1.0" encoding="UTF-8"?> <equation xmlns='http://docbook.org/ns/docbook' version='5'> <title>Fermat's Last Theorem</title> <alt>x^n + y^n ≠ z^n ∀ n ≠ 2</alt> <mathphrase>x<superscript>n</superscript> + y<superscript>n</superscript> ≠ z<superscript>n</superscript> ∀ n ≠ 2</mathphrase> </equation> Thank you, -- http://chris.chiasson.name/

Dear Chris, Associating a schema based on an attribute is not possible in the current version of oXygen. We had this request a couple of time so we will probably implement it in the future. The equation element is not defined as a possible start element in the DocBook schema that you use. You can create a custom version of the schema and extend the start pattern to allow also the equation element, like below: <?xml version="1.0" encoding="UTF-8"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <include href="docbook.rng"/> <start combine="choice"> <ref name="db.equation"/> </start> </grammar> Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Chris Chiasson wrote:
Is there a way to have oXygen select different RELAX NG schemas depending on the version attribute of an XML document's root element?
Also, why, if I make a document like the following, do I receive the error, "element "equation" from namespace "http://docbook.org/ns/docbook" not allowed in this context. Is it not allowed in the schema?
<?xml version="1.0" encoding="UTF-8"?> <equation xmlns='http://docbook.org/ns/docbook' version='5'> <title>Fermat's Last Theorem</title> <alt>x^n + y^n ≠ z^n ∀ n ≠ 2</alt> <mathphrase>x<superscript>n</superscript> + y<superscript>n</superscript> ≠ z<superscript>n</superscript> ∀ n ≠ 2</mathphrase> </equation>
Thank you,
participants (2)
-
Chris Chiasson
-
George Cristian Bina