Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another issue with the same test documents #5

Open
charlie-ablett opened this issue May 30, 2016 · 4 comments
Open

Another issue with the same test documents #5

charlie-ablett opened this issue May 30, 2016 · 4 comments

Comments

@charlie-ablett
Copy link

charlie-ablett commented May 30, 2016

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 :-)

@Pleskan
Copy link

Pleskan commented May 30, 2016

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!

@charlie-ablett
Copy link
Author

charlie-ablett commented May 31, 2016

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)

@Pleskan
Copy link

Pleskan commented May 31, 2016

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.

@charlie-ablett
Copy link
Author

Any thoughts on this @ottoville ? If you had no issues with these documents, could it be my use of Saxon HE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants