Hi Kate,
RelaxNG has a start pattern that points to the elements that can be root
elements. By default the DocBook 5 schema does not include note in the
possible root elements.
You can create a schema that includes the DocBook schema and adds a
choice to the start pattern to add note as root 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="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng"/>
<start combine="choice">
<ref name="db.note"/>
</start>
</grammar>
Then you can refer to this schema from your document, in my case it is
named test.rng and it is in the same folder with the document:
<?oxygen RNGSchema="test.rng" type="xml"?>
<note xmlns="http://docbook.org/ns/docbook" version="5.0">
<title>Separately licensed component required</title>
<para>ECC encryption and FIPS-certified encryption require a separate
license. All strong encryption technologies are subject to export
regulations.</para>
<para>See <olink targetdoc="firstguide"
targetptr="aboutasa-s-3623168">Separately licensed
components</olink>.</para>
</note>
Alternatively you can edit the DocBook5 document type in oXygen to point
to such a schema to get the association automatically without putting it
in the instance documents.
Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
wrote:
>
> I'm trying to create a DocBook 5 RNG file that has a note element as its
> root. However, I keep getting the following error in oXygen:
>
> /E[oNVDL] element "note" from namespace "http://docbook.org/ns/docbook"
> not allowed in this context./
>
> Any ideas about what I'm doing wrong?
>
> Thank you,
> Kate
>
> The following is the xml that I'm using:
>
> /<note xmlns="http://docbook.org/ns/docbook" version="5.0">/
> / <title>Separately licensed component required</title>/
> / <para>ECC encryption and FIPS-certified encryption require a separate
> license. All strong encryption technologies are subject to export
> regulations.</para>/
> / <para>See <olink targetdoc="firstguide"
> targetptr="aboutasa-s-3623168">Separately licensed
> components</olink>.</para>/
> /</note>/
>