Open Bug 134013 Opened 22 years ago Updated 2 years ago

XSLT forbids VariableReference in templates and keys

Categories

(Core :: XSLT, defect)

All
Windows XP
defect

Tracking

()

People

(Reporter: gary.frederick, Assigned: peterv)

References

(Depends on 1 open bug)

Details

Attachments

(5 files, 5 obsolete files)

The template rule 
  <xsl:template match="item[position() mod $thisnup = 1]">
should generate an error because the match attribute has a variable in it.
  http://www.w3.org/TR/xslt#section-Defining-Template-Rules

I like that it does not generate an error. The variable can be resolved at
runtime and the expression with the variable gives me a way to generate
different results, based on the value at runtime.

But it is not correct...

Gary

Attachments in a bit
Attached file xml file that uses the xslt file (obsolete) —
Attached file data for the stylesheet (obsolete) —
pointed to the data.xml file
obsoletes 76602
and
76608 obsoletes 76597
bah. same goes for xsl:key match pattern and use expression.
Sounds like ExprParser needs beat-a-jonas-state-for-this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #76597 - Attachment is obsolete: true
Attachment #76602 - Attachment is obsolete: true
Attachment #76604 - Attachment is obsolete: true
Attachment #76608 - Attachment is obsolete: true
Attachment #76609 - Attachment is obsolete: true
gary reported this to xalan, too 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7603
test for keys coming up (topic corrected).
Wow, that beast crashes on me at a thousand places. But only in module.
And I gave up on gdb on solaris for good right now, somebody with a real
compiler/debugger suite should try.
Summary: XSLT not reporting error when a template rule's match attribute has a variable in it → XSLT forbids VariableReference in templates and keys
testcase for xsl:key/@match, I won't generate a third one for @use.
You get the idea, huh?
Depends on: 216291
*** Bug 344374 has been marked as a duplicate of this bug. ***
QA Contact: keith → xslt
Attached patch v1Splinter Review
Applies on top of attachment 412476 [details] [diff] [review].
Attachment #412477 - Flags: review?(jonas)
I don't see code that would make

aContext->allowed(txIParseContext::VARIABLE_REFERENCE)

return false. Am I missing something?
Comment on attachment 412477 [details] [diff] [review]
v1

No, you're right. Something got lost when splitting up the patches.
Attachment #412477 - Flags: review?(jonas) → review-
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: