Tag Sense for Foreign Markup Within an RNG Schema

For DITA 1.3's new RNG vocabulary support, I've defined an RNG schema for header markup that will be required in all DITA RNG modules and shells. If I set up a validation scenario using this schema then I can validate RNG schemas that use this markup. That is, a scenario that specifies the schema document explicitly. If I put a PI like this: <?xml-model href="urn:oasis:names:tc:dita:rng:vocabularyModuleDesc.rng" schematypens="http://relaxng.org/ns/structure/1.0"?> in one of these documents, then I can set up a validation scenario that uses the "detect schema" option and it also validates. However, what I don't seem to be able to do is get tag sense within the scope of the foreign markup--I only get options for the base RNG vocabulary. Is there a way to get tag sense for the foreign markup? Cheers, E. -- Eliot Kimber, Owner Contrext, LLC, http://contrext.com DITA Solutions for Publishers and those who publish

Hi Eliot, This support is not available. We have this for XML Schema that is implemented as an option allowing to specify a schema for annotations, see Options->Preferences -- Editor / Content Completion / XSD. Probably we should consider a similar approach also for RNG. However, it may be possible to overwrite the schema oXygen uses for Relax NG with a schema that contains also your annotations. We load this schema looking into the Java resources and if you place a library inside oXygen/lib/endorsed containing the same resource then that will be loaded instead of the default one we have in oXygen. Let me test this and I will come back to you with the exact steps to make this work. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 9/21/13 4:47 PM, Eliot Kimber wrote:
For DITA 1.3's new RNG vocabulary support, I've defined an RNG schema for header markup that will be required in all DITA RNG modules and shells.
If I set up a validation scenario using this schema then I can validate RNG schemas that use this markup. That is, a scenario that specifies the schema document explicitly.
If I put a PI like this:
<?xml-model href="urn:oasis:names:tc:dita:rng:vocabularyModuleDesc.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
in one of these documents, then I can set up a validation scenario that uses the "detect schema" option and it also validates.
However, what I don't seem to be able to do is get tag sense within the scope of the foreign markup--I only get options for the base RNG vocabulary.
Is there a way to get tag sense for the foreign markup?
Cheers,
E.

Hi Eliot, Please find below the steps needed to make this work. I renamed the original relaxng.rng to relaxngOriginal.rng and then I created a schema named relaxng.rng that includes the original, now renamed as above. Then I extended the "other" pattern that matches annotations to add an external reference to my annotation schema. See the new relaxng.rng content below: <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="relaxngOriginal.rng"/> <define name="other" combine="choice"> <externalRef href="annotation.rng"/> </define> </grammar> The annotation.rng schema defines some elements so I can test the content completion: <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"> <start> <element name="george" ns="http://www.oxygenxml.com/ns/test"> <element name="x"><empty/></element> <element name="y"><empty/></element> </element> </start> </grammar> I attached you the original renamed Relax NG schema. You need to place all 3 files in a folder named "builtin" and archive them in a jar file then place this jar library in [oXygen]/lib/endorsed - you need to create the endorsed folder and [oxygen] is the home of your oXygen installation. Restart oXygen and the content completion should offer the elements from the annotation schema, in my case george, x and y. Please note that the other wildcard pattern will also match these elements so there will be a relaxed validation on the annotations, you will not be able to control that x and y should be inside george and that y should follow after y, but at least you will get these elements to popup in the content completion. If you want to validate the annotations you need a validation scenario to force the validation with the annotation schema. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 9/22/13 12:26 PM, George Cristian Bina wrote:
Hi Eliot,
This support is not available. We have this for XML Schema that is implemented as an option allowing to specify a schema for annotations, see Options->Preferences -- Editor / Content Completion / XSD. Probably we should consider a similar approach also for RNG.
However, it may be possible to overwrite the schema oXygen uses for Relax NG with a schema that contains also your annotations. We load this schema looking into the Java resources and if you place a library inside oXygen/lib/endorsed containing the same resource then that will be loaded instead of the default one we have in oXygen. Let me test this and I will come back to you with the exact steps to make this work.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 9/21/13 4:47 PM, Eliot Kimber wrote:
For DITA 1.3's new RNG vocabulary support, I've defined an RNG schema for header markup that will be required in all DITA RNG modules and shells.
If I set up a validation scenario using this schema then I can validate RNG schemas that use this markup. That is, a scenario that specifies the schema document explicitly.
If I put a PI like this:
<?xml-model href="urn:oasis:names:tc:dita:rng:vocabularyModuleDesc.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
in one of these documents, then I can set up a validation scenario that uses the "detect schema" option and it also validates.
However, what I don't seem to be able to do is get tag sense within the scope of the foreign markup--I only get options for the base RNG vocabulary.
Is there a way to get tag sense for the foreign markup?
Cheers,
E.
participants (2)
-
Eliot Kimber
-
George Cristian Bina