Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
f37db780
Commit
f37db780
authored
Dec 15, 2015
by
Jean Vintache
Browse files
cleaner insertion of namespace into container
parent
6c10dfff
Changes
3
Hide whitespace changes
Inline
Side-by-side
etherpad_to_hdoc/antce/myantce.ant
View file @
f37db780
...
...
@@ -30,10 +30,8 @@
<!-- Apply Xslt -->
<target
name=
"apply-xslt"
>
<!-- <replaceregexp file="${in}/pad.html" match="<br>" replace="<br />" flags="g" /> -->
<htmlcleaner
src=
"${in}/pad.html"
dest=
"${tmp}/aaaa.xml"
/>
<xslt
classpath=
"lib\saxon9he.jar"
in=
"${xsl}/html2xhtml.xsl"
out=
"${tmp}/tmpPad.xhtml"
style=
"${xsl}/html2xhtml.xsl"
/>
<htmlcleaner
src=
"${in}/pad.html"
dest=
"${tmp}/pad-clean.xml"
/>
<xslt
in=
"${xsl}/html2xhtml.xsl"
out=
"${tmp}/tmpPad.xhtml"
style=
"${xsl}/html2xhtml.xsl"
/>
<xslt
in=
"${tmp}/tmpPad.xhtml"
out=
"${tmp}/tozip/content.xml"
style=
"${xsl}/xhtml2hdoc.xsl"
/>
</target>
...
...
@@ -44,13 +42,14 @@
<!-- container -->
<touch
file=
"${tmp}/tozip/META-INF/container.xml"
/>
<echo
file=
"${tmp}/tozip/META-INF/container.xml"
>
<
container xmlns="urn:utc.fr:ics:hdoc:container" version="1.0"
>
<
rootfiles
>
<
rootfile full-path="${rootfilename}" media-type="text/xml" /
>
<
/rootfiles
>
<
/container
>
</echo>
<echoxml
file=
"${tmp}/tozip/META-INF/container.xml"
>
<container
version=
"1.0"
>
<rootfiles>
<rootfile
full-path=
"${rootfilename}"
media-type=
"text/xml"
/>
</rootfiles>
</container>
</echoxml>
<xslt
classpath=
"lib/saxon9he.jar"
in=
"${tmp}/tozip/META-INF/container.xml"
out=
"${tmp}/META-INF/container.xml"
style=
"${xsl}/addNamespaceToContainer.xsl"
/>
<!-- mimetype -->
<touch
file=
"${tmp}/mimetype"
/>
...
...
@@ -74,6 +73,7 @@
<antcall
target=
"construct_hdoc"
></antcall>
<antcall
target=
"jing-hdoc"
></antcall>
<antcall
target=
"zip"
></antcall>
<antcall
target=
"clean-tmp"
></antcall>
</target>
</project>
\ No newline at end of file
etherpad_to_hdoc/antce/xsl/addNamespaceToContainer.xsl
0 → 100644
View file @
f37db780
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes=
"xs"
version=
"2.0"
xmlns=
"urn:utc.fr:ics:hdoc:container"
>
<xsl:output
method=
"xml"
indent=
"yes"
/>
<!-- Identity transformation -->
<xsl:template
match=
"node()|@*"
>
<xsl:copy>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:copy>
</xsl:template>
<!-- Namespace substitution for hdoc elements -->
<xsl:template
match=
"*"
priority=
"1"
>
<xsl:element
name=
"{local-name()}"
>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:element>
</xsl:template>
<xsl:template
match=
"container"
priority=
"2"
>
<xsl:processing-instruction
name=
"oxygen"
>
RNGSchema="http://scenari.utc.fr/hdoc/schemas/container/hdoc1-container.rng" type="xml"
</xsl:processing-instruction>
<xsl:element
name=
"{local-name()}"
>
<xsl:apply-templates
select=
"node()|@*"
/>
</xsl:element>
</xsl:template>
<!-- Suppress processing-instructions -->
<xsl:template
match=
"processing-instruction()"
priority=
"1"
/>
</xsl:stylesheet>
\ No newline at end of file
etherpad_to_hdoc/antce/xsl/html2xhtml.xsl
View file @
f37db780
...
...
@@ -8,7 +8,7 @@
<xsl:strip-space
elements=
"*"
/>
<xsl:param
name=
"text-encoding"
as=
"xs:string"
select=
"'utf-8'"
/>
<xsl:param
name=
"text-uri"
as=
"xs:string"
select=
"'../tmp/
aaaa
.xml'"
/>
<xsl:param
name=
"text-uri"
as=
"xs:string"
select=
"'../tmp/
pad-clean
.xml'"
/>
<xsl:template
name=
"text2xml"
>
<xsl:variable
name=
"text"
select=
"unparsed-text($text-uri, $text-encoding)"
/>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment