Open charlie-ablett opened 8 years ago
Hello!
You would just see how to fix this errors at my fork of DOCX2HTML.XSL https://github.com/Pleskan/DOCX2HTML.XSL/blob/master/docx2html.xsl line 203 and line 216. Or simply copy/pase the strings to you XSL.
Good Luck!
Hi @Pleskan - thanks for your reply.
Replaced line 203:
<xsl:value-of select="concat('p>span { ')"/><xsl:apply-templates select="w:rPr" /> }
with
<xsl:value-of select="concat('p>span',' { ')"/><xsl:apply-templates select="w:rPr" /> }
and 216, replacing
<xsl:value-of select="concat('span { ')"/><xsl:apply-templates select="w:rPr" /> }
with
<xsl:value-of select="concat('span',' { ')"/><xsl:apply-templates select="w:rPr" /> }
That results in different errors:
XTRE0540: Ambiguous rule match for /w:document/w:body[1]/w:p[38]/w:r[1]
Matches both
"element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar)[(data(attribute::attribute(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldCharType))) = "begin"]]" on line 126 of file:/home/charlie/RubymineProjects/ink-api/app/logic/conversion/step_logic/docx_to_html_ottoville/text.xsl
and "element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[(not(child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tab))) and (not((data(((first(preceding-sibling::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[exists(child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar))]))/child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar))/attribute::attribute(Q{http://schemas.ope
Error
XTRE0540: Ambiguous rule match for /w:document/w:body[1]/w:p[38]/w:hyperlink[1]/w:r[3]
Matches both
"element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar)[(data(attribute::attribute(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldCharType))) = "begin"]]" on line 126 of file:/home/charlie/RubymineProjects/ink-api/app/logic/conversion/step_logic/docx_to_html_ottoville/text.xsl
and "element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[(not(child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tab))) and (not((data(((first(preceding-sibling::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r)[exists(child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar))]))/child::element(Q{http://schemas.openxmlformats.org/wordprocessingml/2006/main}fldChar))/attribute::attribute(Q{htt
<snip - lots more>
and for another file
java.lang.RuntimeException: Internal error evaluating template rule at line 220 in module file:/path/project/docx2html.xsl at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:402) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:456) at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433) at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433) at net.sf.saxon.Controller.transformDocument(Controller.java:2270) at net.sf.saxon.Controller.transform(Controller.java:1847) at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:553) at net.sf.saxon.Transform.processFile(Transform.java:1222) at net.sf.saxon.Transform.doTransform(Transform.java:778) at net.sf.saxon.Transform.main(Transform.java:77)
Hm, this approach works well for me, using Oxygen 17.1 IDE. I don't know where is the bug in your case. After this fix I have only some recoverable errors appears, nothing else. For example clone my repo completely and try to use it in your transformation.
Any thoughts on this @ottoville ? If you had no issues with these documents, could it be my use of Saxon HE?
I tried the new xsl files you provided in the last issue (with the same documents I provided).
I now get:
Static error in {concat('p>span { ')} in expression in xsl:value-of/@select on line 203 column 48 of docx2html.xsl: XPST0017: System function concat() cannot be called with one argument Static error in {concat('span { ')} in expression in xsl:value-of/@select on line 216 column 46 of docx2html.xsl: XPST0017: System function concat() cannot be called with one argument Errors were reported during stylesheet compilation
Would I be able to get some help?
Many thanks :-)