Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
ca4fef53
Commit
ca4fef53
authored
Dec 22, 2016
by
Raphaël
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding of schema validation for container.xml
parent
3a07fa62
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
505 additions
and
1 deletion
+505
-1
hdoc_to_pdf/hdoc_to_pdf.ant
hdoc_to_pdf/hdoc_to_pdf.ant
+15
-1
hdoc_to_pdf/lib/jing.jar
hdoc_to_pdf/lib/jing.jar
+0
-0
hdoc_to_pdf/schemas/container/hdoc1-container.rng
hdoc_to_pdf/schemas/container/hdoc1-container.rng
+32
-0
hdoc_to_pdf/schemas/xhtml/hdoc1-xhtml.rng
hdoc_to_pdf/schemas/xhtml/hdoc1-xhtml.rng
+364
-0
hdoc_to_pdf/schemas/xhtml/type.rng
hdoc_to_pdf/schemas/xhtml/type.rng
+94
-0
No files found.
hdoc_to_pdf/hdoc_to_pdf.ant
View file @
ca4fef53
...
...
@@ -6,10 +6,12 @@
<pathelement
location=
"lib/ant-contrib.jar"
/>
</classpath>
</taskdef>
<taskdef
name=
"jing"
classname=
"com.thaiopensource.relaxng.util.JingTask"
/>
<!-- Arguments properties -->
<property
name=
"InputPath"
location=
"input"
/>
<property
name=
"OutputPath"
location=
"output"
/>
<property
name=
"Schema"
location=
"schemas"
/>
<property
name=
"tmpdir"
location=
"${basedir}/tmp"
/>
<property
name=
"OutputFileName"
location=
"${OutputPath}/result.pdf"
/>
...
...
@@ -24,6 +26,8 @@
</target>
<target
name=
"hdocPreparation"
>
...
...
@@ -61,7 +65,17 @@
<!-- Gives all rights to avoid bugs-->
<chmod
dir=
"${tmpdir}"
perm=
"777"
/>
<!-- Launches the XSLT find_content to retrieve the content path -->
<!-- Validating the XML container file -->
<trycatch
property=
"foo"
reference=
"bar"
>
<try>
<jing
file=
"${tmpdir}/META-INF/container.xml"
rngfile=
"${Schema}/container/hdoc1-container.rng"
></jing>
</try>
<catch>
<echo>
Validation failed
</echo>
</catch>
</trycatch>
<!-- Launches the XSLT find_content to retrieve the content path -->
<xslt
in=
"${tmpdir}/META-INF/container.xml"
out=
"${tmpdir}/prepare_hdoc.ant"
classpath=
"./lib/saxon9he.jar"
style=
"xsl/find_content.xsl"
>
<param
name=
"BaseDirectory"
expression=
"${basedir}"
/>
<param
name=
"TempDirectory"
expression=
"${tmpdir}"
/>
...
...
hdoc_to_pdf/lib/jing.jar
0 → 100644
View file @
ca4fef53
File added
hdoc_to_pdf/schemas/container/hdoc1-container.rng
0 → 100644
View file @
ca4fef53
<?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"
ns=
"urn:utc.fr:ics:hdoc:container"
>
<a:documentation>
This schema describes the META-INF/container.xml file for hdoc format
</a:documentation>
<a:documentation>
This schema is a derivation of http://www.idpf.org/epub/30/schema/ocf-container-30.rnc
from EPUB Open Container Format (http://www.idpf.org/epub/30/spec/epub30-ocf.html)
</a:documentation>
<start>
<element
name=
"container"
>
<attribute
name=
"version"
>
<value>
1.0
</value>
</attribute>
<element
name=
"rootfiles"
>
<element
name=
"rootfile"
>
<attribute
name=
"full-path"
>
<data
type=
"anyURI"
/>
</attribute>
<attribute
name=
"media-type"
>
<value>
text/xml
</value>
</attribute>
</element>
</element>
</element>
</start>
</grammar>
hdoc_to_pdf/schemas/xhtml/hdoc1-xhtml.rng
0 → 100644
View file @
ca4fef53
This diff is collapsed.
Click to expand it.
hdoc_to_pdf/schemas/xhtml/type.rng
0 → 100644
View file @
ca4fef53
<?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"
ns=
"http://www.utc.fr/ics/hdoc/xhtml"
>
<a:documentation>
Last update : 2014-12-04
</a:documentation>
<a:documentation>
Changes since last update :
In order to manage quiz :
- Adding multiple-choice-question and fill-in-the-blank to section
- Adding question, choice-correct, choice-uncorrect and explanation to div
- Adding blank to span
- Externalizing ObjectType and VideoType from main schema
</a:documentation>
<!-- Type Microdata -->
<define
name=
"SectionType"
>
<optional>
<attribute
name=
"data-hdoc-type"
>
<choice>
<value>
introduction
</value>
<value>
conclusion
</value>
<value>
unit-of-content
</value>
<value>
multiple-choice-question
</value>
<value>
fill-in-the-blank
</value>
<value>
division
</value>
<value>
grain
</value>
<value>
exercise
</value>
<value>
activity
</value>
<value>
aims
</value>
<value>
synthesis
</value>
</choice>
</attribute>
</optional>
</define>
<define
name=
"DivType"
>
<optional>
<attribute
name=
"data-hdoc-type"
>
<choice>
<!-- block management -->
<value>
emphasis
</value>
<value>
complement
</value>
<value>
definition
</value>
<value>
example
</value>
<value>
remark
</value>
<value>
warning
</value>
<value>
advice
</value>
<!-- quiz management -->
<value>
question
</value>
<value>
choice-correct
</value>
<value>
choice-incorrect
</value>
<value>
explanation
</value>
<value>
explanation-choice-correct
</value>
<value>
explanation-choice-incorrect
</value>
</choice>
</attribute>
</optional>
</define>
<define
name=
"SpanType"
>
<optional>
<attribute
name=
"data-hdoc-type"
>
<choice>
<value>
syntax
</value>
<value>
latex
</value>
<!-- quiz management -->
<value>
blank
</value>
</choice>
</attribute>
</optional>
</define>
<define
name=
"ObjectType"
>
<attribute
name=
"type"
>
<choice>
<value>
application/vnd.oasis.opendocument.graphics
</value>
<value>
application/vnd.oasis.opendocument.spreadsheet
</value>
<value>
application/pdf
</value>
<value>
application/x-listing
</value>
</choice>
</attribute>
</define>
<define
name=
"VideoType"
>
<attribute
name=
"type"
>
<choice>
<value>
video/mp4
</value>
<value>
video/ogg
</value>
<value>
video/webm
</value>
</choice>
</attribute>
</define>
</grammar>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment