Closed Bug 34565 Opened 26 years ago Closed 26 years ago

implement extended <template> condition syntax

Categories

(Core :: XUL, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: waterson, Assigned: waterson)

Details

Attachments

(2 files)

Implement and document extended syntax for template rules.
rjc: hyatt and I had a brief discussion about this today. I'll just summarize real quickly so I don't forget anything. The syntax is sort of like OPS-5 or Prolog, if you've seen either of those. - An existing rule like this: <rule nc:color="blue" parent="menu"> ...</rule> would look something like this if written verbosely: <rule> <conditions> <content id="?a" name="menu" /> <member container="?a" child="?b" /> <rdf source="?b" property="http://home.netscape.com/NC-rdf#color" target="blue" /> </conditions> </rule> (This is *not* to say that you have to write it verbosely!) - The "?a" is a variable that gets bound to a value, and is consistently bound across all conditions of the rule. - The different tags inside the <conditions> elements represent tests: <content id="..." name="..." /> tests for a content node in the DOM with an 'id' (or 'ref') attribute with the specified value, and optionally a tag with the specified name. <member container="..." child="..." /> Tests for RDF container membership, using either the Bag/Seq/Alt or currently active "containment properties". <rdf source="..." property="..." target="..." /> Tests for the specified triple in the RDF graph. - You can use variables in the "right-hand side" of the rule (that is, the content that gets built). For example, <rule> <conditions><!-- with conditions from above --></conditions> <treechildren> <treeitem id="?b">...</treeitem> </treechildren> </rule> - All the conditions in the <conditions> section *must* match for the rule to match. - There will be an additional <bindings> section that provides additional, optional graph binding; e.g., <rule> <conditions><!-- from above --></conditions> <bindings> <rdf source="?b" property="http://home.netscape.com/NC-rdf#name" target="?c" /> </bindings> <treechildren> <treeitem id="?b"> <treerow><treecell value="?c" /></treerow> </treeitem> </treechildren> </rule> This would pull through the "name" property onto the tree's "value" attribute, if a name property existed. It would just create an empty treecell with no value attribute if the name property didn't exist.
Status: NEW → ASSIGNED
Priority: P3 → P2
Target Milestone: --- → M16
Putting this on our radar.
Keywords: zopestudio
initial implementation checked in. docs forthcoming: i'll post to n.p.m.xpfe and n.p.m.rdf. it's still limited in its current support.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Attached file save as "ext.xul" —
Attached file save as "ext.rdf" —
to verify, save "ext.xul" and "ext.rdf" to same directory, then open from URL bar (or "open->file"). You should see a button and a tree control containing "one two three".
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: