This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 6218 - [UPD] small problem in the update grammar applet
Summary: [UPD] small problem in the update grammar applet
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-11 22:35 UTC by Andrew Eisenberg
Modified: 2009-06-25 19:31 UTC (History)
2 users (show)

See Also:


Attachments

Description Andrew Eisenberg 2008-11-11 22:35:57 UTC
The update grammar applet (http://www.w3.org/2007/01/applets/xquery-updateApplet.html) parses queries like:

$x

It also parses:

$for

It does not, however, parse:

$updating

The error message generated is:

Encountered "$ updating" at line 1, column 1.
Was expecting one of:
    "xquery" ...
    "version" ...
    "encoding" ...
    "module" ...
    "namespace" ...
    "declare" ...
    "boundary-space" ...
    "preserve" ...
    "strip" ...
    "default" ...
    "element" ...
    "function" ...
    "option" ...
    "ordering" ...
    "ordered" ...
    "unordered" ...
    "order" ...
    "empty" ...
    "copy-namespaces" ...
    "no-preserve" ...
    "inherit" ...
    "no-inherit" ...
    "collation" ...
    "base-uri" ...
    "import" ...
    "schema" ...
    "at" ...
    "variable" ...
    "construction" ...
    "as" ...
    "return" ...
    "for" ...
    "in" ...
    "let" ...
    "where" ...
    "by" ...
    "stable" ...
    "some" ...
    "every" ...
    "satisfies" ...
    "typeswitch" ...
    "case" ...
    "if" ...
    "then" ...
    "else" ...
    "or" ...
    "and" ...
    "to" ...
    "*" ...
    "div" ...
    "idiv" ...
    "mod" ...
    "union" ...
    "intersect" ...
    "except" ...
    "instance" ...
    "of" ...
    "treat" ...
    "castable" ...
    "cast" ...
    "eq" ...
    "ne" ...
    "lt" ...
    "le" ...
    "gt" ...
    "ge" ...
    "is" ...
    "validate" ...
    "lax" ...
    "strict" ...
    "child" ...
    "descendant" ...
    "attribute" ...
    "self" ...
    "descendant-or-self" ...
    "following-sibling" ...
    "following" ...
    "@" ...
    "parent" ...
    "ancestor" ...
    "preceding-sibling" ...
    "preceding" ...
    "ancestor-or-self" ...
    ".." ...
    "document" ...
    "text" ...
    "comment" ...
    "processing-instruction" ...
    "empty-sequence" ...
    "item" ...
    "node" ...
    "document-node" ...
    "schema-attribute" ...
    "schema-element" ...
    "first" ...
    "last" ...
    "into" ...
    "after" ...
    "before" ...
    "insert" ...
    "nodes" ...
    "delete" ...
    "replace" ...
    "value" ...
    "rename" ...
    "copy" ...
    "modify" ...
    "update" ...
    "transform" ...
    "do" ...
    "type" ...
    "-" ...
    "+" ...
    "external" ...
    "ascending" ...
    "descending" ...
    "greatest" ...
    "least" ...
    <QNameToken> ...
    <NCNameColonStar> ...
    <StarColonNCName> ...
    <IntegerLiteral> ...
    <DecimalLiteral> ...
    <DoubleLiteral> ...
    <StringLiteral> ...
    "$" <QNameToken> ...
    "$" "external" ...
    "$" "xquery" ...
    "$" "version" ...
    "$" "encoding" ...
    "$" "module" ...
    "$" "namespace" ...
    "$" "declare" ...
    "$" "boundary-space" ...
    "$" "preserve" ...
    "$" "strip" ...
    "$" "default" ...
    "$" "function" ...
    "$" "option" ...
    "$" "ordering" ...
    "$" "ordered" ...
    "$" "unordered" ...
    "$" "order" ...
    "$" "empty" ...
    "$" "greatest" ...
    "$" "least" ...
    "$" "copy-namespaces" ...
    "$" "no-preserve" ...
    "$" "inherit" ...
    "$" "no-inherit" ...
    "$" "collation" ...
    "$" "base-uri" ...
    "$" "import" ...
    "$" "schema" ...
    "$" "at" ...
    "$" "variable" ...
    "$" "construction" ...
    "$" "update" ...
    "$" "as" ...
    "$" "lax" ...
    "$" "strict" ...
    "$" "return" ...
    "$" "transform" ...
    "$" "do" ...
    "$" "for" ...
    "$" "in" ...
    "$" "let" ...
    "$" "where" ...
    "$" "by" ...
    "$" "stable" ...
    "$" "ascending" ...
    "$" "descending" ...
    "$" "some" ...
    "$" "every" ...
    "$" "satisfies" ...
    "$" "case" ...
    "$" "then" ...
    "$" "else" ...
    "$" "or" ...
    "$" "and" ...
    "$" "to" ...
    "$" "div" ...
    "$" "idiv" ...
    "$" "mod" ...
    "$" "union" ...
    "$" "intersect" ...
    "$" "except" ...
    "$" "instance" ...
    "$" "of" ...
    "$" "treat" ...
    "$" "castable" ...
    "$" "cast" ...
    "$" "eq" ...
    "$" "ne" ...
    "$" "lt" ...
    "$" "le" ...
    "$" "gt" ...
    "$" "ge" ...
    "$" "is" ...
    "$" "validate" ...
    "$" "child" ...
    "$" "descendant" ...
    "$" "self" ...
    "$" "descendant-or-self" ...
    "$" "following-sibling" ...
    "$" "following" ...
    "$" "parent" ...
    "$" "ancestor" ...
    "$" "preceding-sibling" ...
    "$" "preceding" ...
    "$" "ancestor-or-self" ...
    "$" "document" ...
    "$" "insert" ...
    "$" "first" ...
    "$" "last" ...
    "$" "into" ...
    "$" "after" ...
    "$" "before" ...
    "$" "delete" ...
    "$" "replace" ...
    "$" "value" ...
    "$" "rename" ...
    "$" "copy" ...
    "$" "modify" ...
    "$" "nodes" ...
    "$" "type" ...
    "$" "attribute" ...
    "$" "comment" ...
    "$" "document-node" ...
    "$" "element" ...
    "$" "if" ...
    "$" "item" ...
    "$" "node" ...
    "$" "processing-instruction" ...
    "$" "schema-attribute" ...
    "$" "schema-element" ...
    "$" "text" ...
    "$" "typeswitch" ...
    "$" "empty-sequence" ...
    "(" ...
    "." ...
    "<" ...
    "<" ...
    "<!--" ...
    "<!--" ...
    "<?" ...
    "<?" ...
Comment 1 Michael Dyck 2009-05-05 18:55:56 UTC
It looks like the solution is simply to add
    <g:string process-value="yes" if="update">updating</g:string>
to the g:production for FunctionQName in xpath-grammar.xml.
Of course, there may be other keywords that need a similar treatment.

(It seems odd to me that we don't (in effect) generate the production 
for FunctionQName automatically. It would avoid this kind of problem.)
Comment 2 Andrew Eisenberg 2009-05-05 21:38:57 UTC
I've done some additional testing, and find that 4 of our keywords cannot be used as variable names. These are "revalidation", "skip", "updating", and "with".

Comment 3 Jonathan Robie 2009-05-22 21:01:45 UTC
(In reply to comment #2)
> I've done some additional testing, and find that 4 of our keywords cannot be
> used as variable names. These are "revalidation", "skip", "updating", and
> "with".
> 

I just checked in a version that recognizes these all as QNames.