0

How can I instruct XQuery to copy these SSI directives (HTML comments) from an XQuery file (.xq) to the output html file.

<!--#set var="tab4" value="true" -->
<!--#include virtual="/common/content/header.shtml" -->

I'm using Saxon and I'm getting the following error:

  Error on line 2 column 2 of _download.xq:
  XPST0003 XQuery syntax error near #...ar="tab4" value="true" --> <!-#:
  Unexpected token "!" in path expression
  Static error(s) in query
TechAurelian
  • 5,561
  • 5
  • 50
  • 65

1 Answers1

1

XQuery allows you to just insert the comments anywhere you would insert literal elements. Just be aware that they are seen as two separate nodes, and may need a comma in between, and perhaps even parentheses, to make a sequence of them. Depends on where in your code you inserted them.

grtjn
  • 20,254
  • 1
  • 24
  • 35
  • If I insert them at the very beginning of the XQuery file, I get an error. If I insert them after a tag like , it works fine. But this opens another problem, as I am no longer able to insert the HTML5 doctype , that was in the header.shtml file. – TechAurelian Feb 16 '12 at 13:08
  • If you insert it at the beginning of your XQuery, you will indeed need the comma I said. Put it between `-->` and ``.. – grtjn Feb 16 '12 at 15:26