#649 TEI transformation can't finish creating all files that should go in the EPUB file

AMBER
closed
nobody
5(default)
2014-08-12
2014-03-07
No

The EPUB transformation (tei/stylesheet/epub/build-to.xml) applied to a TEI P5 XML file fails with an error like:

notodd:
[mkdir] Created dir: C:\Users\sorin\AppData\Local\Temp\build1820404034
[echo] XSLT generate ePub files in C:\Users\sorin\AppData\Local\Temp\build1820404034
[xslt] Processing S:\projects\eXml-trunk\samples\tei\TEI-P5.xml to C:\Users\sorin\AppData\Local\Temp\build1820404034\OPS\index.html
[xslt] S:\projects\eXml-trunk\frameworks\tei\xml\tei\stylesheet\html\html_textstructure.xsl:461: Fatal Error! Resolved URL is malformed Cause: java.net.MalformedURLException: unknown protocol: c
[xslt] Failed to process S:\projects\eXml-trunk\samples\tei\TEI-P5.xml

BUILD FAILED
S:\projects\eXml-trunk\frameworks\tei\xml\tei\stylesheet\epub\build-to.xml:38: The following error occurred while executing this line:
S:\projects\eXml-trunk\frameworks\tei\xml\tei\stylesheet\common\teianttasks.xml:237: Fatal error during transformation using S:\projects\eXml-trunk\frameworks\tei\xml\tei\stylesheet\profiles\default\epub\to.xsl: Resolved URL is malformed; SystemID: file:/S:/projects/eXml-trunk/frameworks/tei/xml/tei/stylesheet/html/html_textstructure.xsl; Line#: 461; Column#: -1

The problem seems to be the values of the many outName variables used in the href attribute for creating output files in the tei/stylesheet/html/html_textstructure.xsl stylesheet, in elements like:

<xsl:result-document doctype-public="{$doctypePublic}" doctype-system="{$doctypeSystem}" encoding="{$outputEncoding}" href="{$outName}"

The value of the profile parameter of the EPUB transformation is default.

Discussion

• Sebastian Rahtz - 2014-03-07

that is strange. this is the "java.net.MalformedURLException: unknown protocol: c" problem which we have met before.

I will try and work through the problem.

• Martin Holmes - 2014-03-07

This has to be a problem with Windows, surely? c:\ (a drive) being interpreted as a protocol?

Perhaps it's just a question of putting file:/// before local paths?

• Sebastian Rahtz - 2014-03-07

• Sebastian Rahtz - 2014-03-07

I have changed the offending line as follows
- href="{$outName}" + href="{if (matches($outName,'^[A-z]:')) then + concat('file:///',$outName) else$outName}"

which seems to fix the problem OK. Does that seem plausible?

• Sorin Ristache - 2014-03-13

It certainly does seem plausible, although I would make the change in the template with name="outputChunkName" in html/html_textstructure.xsl, in order to apply it to all <xsl:result-document> elements having an \$outName href value.

Last edit: Sorin Ristache 2014-03-13
• Sebastian Rahtz - 2014-03-13

you are right, I will move the logic to the more general template.

• Sebastian Rahtz - 2014-03-24
• status: open --> closed