Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
1474eecf
Commit
1474eecf
authored
7 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Extended RelaxNG example
parent
b054fff2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
XmlCross/xmlcross.xml
+24
-29
24 additions, 29 deletions
XmlCross/xmlcross.xml
with
24 additions
and
29 deletions
XmlCross/xmlcross.xml
+
24
−
29
View file @
1474eecf
...
...
@@ -2423,12 +2423,19 @@ xmlns="http://docbook.org/ns/docbook">
<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"
>
<
book
>
<programlisting
language=
"xml"
>
<
book
lang="en"
>
<
chapter
>
<
title
>
Introduction
<
/title
>
<
paragraph
>
Some text.
<
/paragraph
>
...
...
@@ -2436,7 +2443,7 @@ xmlns="http://docbook.org/ns/docbook">
<
/chapter
>
<
chapter
>
<
title
>
Go on ...
<
/title
>
<
paragraph
>
There is more to come here
.
<
/paragraph
>
<
paragraph
lang="de"
>
Hier kommt noch etwas
.
<
/paragraph
>
<
/chapter
>
<
/book
>
</programlisting>
...
...
@@ -2465,10 +2472,20 @@ xmlns="http://docbook.org/ns/docbook">
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"
>
<
?xml version="1.0" encoding="UTF-8"?
>
<
grammar
xmlns="http://relaxng.org/ns/structure/1.0"
...
...
@@ -2480,35 +2497,13 @@ xmlns="http://docbook.org/ns/docbook">
<
define name="d.book"
>
<
element name="book"
>
<
oneOrMore
>
<
ref name="d.chapter"/
>
<
/oneOrMore
>
<
/element
>
<
/define
>
<
define name="d.chapter"
>
<
element name="chapter"
>
<
ref name="d.title"/
>
<
oneOrMore
>
<
ref name="d.paragraph"/
>
<
/oneOrMore
>
<
/element
>
<
/define
>
<
define name="d.title"
>
<
element name="title"
>
<
text
><
/text
>
<
/element
>
<
/define
>
<
define name="d.paragraph"
>
<
element name="paragraph"
>
<
text
><
/text
>
<
text/
>
<
/element
>
<
/define
>
<emphasis
role=
"bold"
>
<
!-- TODO: extend me accordingly ... --
>
</emphasis>
<
/grammar
>
</programlisting>
</
answer
>
</
question
>
</qandaentry>
</qandadiv>
</qandaset>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment