Hi Christian,

you wrote:> I’m being presented with the following error message:
> 
> [XPST0003] Invalid value, simple expression expected.

Me too, if I just copy and paste the code I have sent. See, attached, a
simple module, that produces the error I named first.

> The error message is correct, because your comment already ends at
> line 7, column 37:
> 
> .... ?#]+):)

Aehm, no, that is still part of the regular expression. See the quotes
around the regex encapsulating the :) part. If you remove the comment,
that code block will execute and produce this result:

  <fn:analyze-string-result
xmlns:fn="http://www.w3.org/2005/xpath-functions";>
    <fn:match>
      <fn:group nr="1">
        <fn:group nr="2">http</fn:group>:</fn:group>
      <fn:group nr="3">//<fn:group nr="4">192.168.2.1</fn:group>
      </fn:group>
      <fn:group nr="5">/index.html</fn:group>
      <fn:group nr="6">?<fn:group nr="7">bla=2</fn:group>
      </fn:group>
    </fn:match>
  </fn:analyze-string-result>


> I’m not sure how you got this "no expression allowed in library
> module" error message. Could you possibly provide us a step-by-step
> example?

Sure, see attached file. I just re-tested. The file, as is, produces

"No expression allowed in library module"

If you remove the first line ('module namespace foo = "foo:bar";'), then
mark the out-commented code block and hit CTRL-K, it removes the
outermost (: :), the block becomes executable and produces mentioned result.

-- 
Goody Bye, Minden jót, Mit freundlichen Grüßen,
Andreas Mixich

Attachment: editor-comment-issue.xqm
Description: application/xquery

Reply via email to