Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top