Closed Bug 86270 Opened 23 years ago Closed 23 years ago

implement default templates using code

Categories

(Core :: XSLT, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: sicking, Assigned: sicking)

References

Details

Attachments

(2 files)

we should implement default templates using code instead of inserting them into 
the xsl document. There is two advantages with this:

1. All default templates can't be implemented by inserting nodes in the xslt-dom
2. We don't have to modify the xslt document given to us
The patch basically does two things. It removes the code that adds the default 
templates to the xslt document, and it adds an extra |else 
processDefaultTemplate(...);| to each |if(xslTemplate) processTemplate(...);|
Status: NEW → ASSIGNED
Keywords: review
I like it, but we now have this every time:

if (xslTemplate)
    processTemplate(node, xslTemplate, ps);
else
    processDefaultTemplate(node, ps, mode);

Do you think we could put the NULL check and processDefaultTemplate inside
processTemplate? So that we (I?) don't forget adding the processDefaultTemplate
after every processTemplate. Then again, it might be too much trouble for the
few cases. 
I originally did it that way (see attachment 34255 [details] [diff] [review]), but I wasn't quite happy 
with it. First of all I had to send |mode| to processTemplate which would only 
be used by the default-template code. Second, there is code that calls 
processTemplate but _should't_ invoke default templates (the code for xsl:call-
template).

So, could I convince you to the current flow?
r=peterv.
Whiteboard: Fix in hand. Have r=peterv. Need sr=, a=.
Target Milestone: --- → mozilla0.9.2
sr=jst
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: review
Resolution: --- → FIXED
Whiteboard: Fix in hand. Have r=peterv. Need sr=, a=.
bitching buttons, verfication spam
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: