From 1474eecfc4dd6f363c8419e2b7efb9b21fd17b34 Mon Sep 17 00:00:00 2001
From: Martin Goik <goik@hdm-stuttgart.de>
Date: Tue, 15 Aug 2017 11:48:20 +0300
Subject: [PATCH] Extended RelaxNG example

---
 XmlCross/xmlcross.xml | 53 ++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/XmlCross/xmlcross.xml b/XmlCross/xmlcross.xml
index 61bc3e95d..2c06db3e5 100644
--- a/XmlCross/xmlcross.xml
+++ b/XmlCross/xmlcross.xml
@@ -2423,12 +2423,19 @@ xmlns="http://docbook.org/ns/docbook"&gt;
       <qandadiv>
         <qandaentry>
           <question>
+            <para>Read the <link
+            xlink:href="http://relaxng.org/tutorial-20011203.html">RELAX NG
+            Tutorial</link>. You may want to import the examples into your
+            OxygenXML <xref linkend="glo_IDE"/>. Based on this knowledge you
+            ar being asked to model a schema describing simple <tag
+            class="starttag">book</tag> documents.</para>
+
             <para>Use <link
             xlink:href="https://www.oxygenxml.com/xml_editor.html">Oxygen XML
             Editor</link> to create a RelaxNG <filename>book.rng</filename>
             schema suiting the subsequent document sample:</para>
 
-            <programlisting language="xml">&lt;book&gt;
+            <programlisting language="xml">&lt;book lang="en"&gt;
    &lt;chapter&gt;
        &lt;title&gt;Introduction&lt;/title&gt;
        &lt;paragraph&gt;Some text.&lt;/paragraph&gt;
@@ -2436,7 +2443,7 @@ xmlns="http://docbook.org/ns/docbook"&gt;
    &lt;/chapter&gt;
     &lt;chapter&gt;
         &lt;title&gt;Go on ...&lt;/title&gt;
-        &lt;paragraph&gt;There is more to come here.&lt;/paragraph&gt;
+        &lt;paragraph lang="de"&gt;Hier kommt noch etwas.&lt;/paragraph&gt;
     &lt;/chapter&gt;
 &lt;/book&gt;</programlisting>
 
@@ -2465,10 +2472,20 @@ xmlns="http://docbook.org/ns/docbook"&gt;
                 class="starttag">paragraph</tag> consist of ordinary
                 text.</para>
               </listitem>
+
+              <listitem>
+                <para>Both <tag class="starttag">book</tag> and <tag
+                class="starttag">para</tag> elements may have an optional
+                <property>lang</property> attribute like <code>en</code>,
+                <code>fi</code>, <code>es</code>, <code>it</code> and so on.
+                Use the data type <code
+                xlink:href="http://www.kohsuke.org/relaxng/shorthand/ShortRNG.html#IDAPBSS">NMTOKEN</code>.</para>
+              </listitem>
             </itemizedlist>
-          </question>
 
-          <answer>
+            <para>You may want to start from the following file
+            <filename>mybook.rng</filename>:</para>
+
             <programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
 &lt;grammar 
     xmlns="http://relaxng.org/ns/structure/1.0"
@@ -2480,35 +2497,13 @@ xmlns="http://docbook.org/ns/docbook"&gt;
     
     &lt;define name="d.book"&gt;
         &lt;element name="book"&gt;
-            &lt;oneOrMore&gt;
-                &lt;ref name="d.chapter"/&gt;
-            &lt;/oneOrMore&gt;
-        &lt;/element&gt;
-    &lt;/define&gt;
-    
-    &lt;define name="d.chapter"&gt;
-        &lt;element name="chapter"&gt;
-            &lt;ref name="d.title"/&gt;
-            &lt;oneOrMore&gt;
-                &lt;ref name="d.paragraph"/&gt;
-            &lt;/oneOrMore&gt;
-        &lt;/element&gt;
-    &lt;/define&gt;
-
-    &lt;define name="d.title"&gt;
-        &lt;element name="title"&gt;
-            &lt;text&gt;&lt;/text&gt;
-        &lt;/element&gt;
-    &lt;/define&gt;
-    
-    &lt;define name="d.paragraph"&gt;
-        &lt;element name="paragraph"&gt;
-            &lt;text&gt;&lt;/text&gt;
+            &lt;text/&gt;
         &lt;/element&gt;
     &lt;/define&gt;
     
+    <emphasis role="bold">&lt;!-- TODO: extend me accordingly ... --&gt;</emphasis>
 &lt;/grammar&gt;</programlisting>
-          </answer>
+          </question>
         </qandaentry>
       </qandadiv>
     </qandaset>
-- 
GitLab