Re: RDF Containers in XUL Trees

Axel Hecht <[email protected]>
Newsgroups gmane.comp.mozilla.devel.rdf
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Neil Stansbury wrote:
> Hi all,
> 
> I had intended to use my own class to describe containers and produce a 
> XUL tree, for example:
> 
> -----
> 
> <my:Container rdf:about="level1" my:name="Parent">
>   <rdf:li rdf:resource="level2"/>
> </my:Container>
> 
> <my:Container rdf:about="level2" my:name="Child">
>   <rdf:li rdf:resource="level3"/>
> </my:Container>
> 
> <my:Container rdf:about="level3" my:name="Sub-Child">
>   <rdf:li rdf:resource="level4"/>
> </my:Container>
> 
> -----
> 
> 1. What causes templated trees to create twisty children? I had assumed 
> it was any declared container, and that I could use <rdf:instanceOf> and 
> declare my:Container as:
> 
> <rdf:instanceOf
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
> 
> But I can't get the tree to build any element unless I use Seq collections
> 

You can use containment or whatever the attribute is actually called on 
the template to add arcs to iterate over. What you do is hardly going to 
do alot useful, though.

You could use plain containers, and use a instanceOf in the enum to add 
a new class. Or you go without it completely. Mixing rdf:li with other 
parents is likely to achieve brokeness.

> 2. I had intended to use my own class collection to be more semantically 
>  correct, and allow me to test for a resource having that class property.
> 
> Are there any disadvantages from Mozilla's point of view of not just 
> using vanilla <rdf:Seq>, <rdf:li>, <rdf:Description> combinations to 
> achieve the same thing?

rdf:li is a very special element, it generates rdf:_n arcs instead of 
rdf:li, but only if used in the right context. Stick close the spec 
here, and don't expect miracles on edge cases.

> I though I read somewhere that some of the XPCOM methods like 
> GetSources() only worked properly with standard rdf containers?

There is no such thing as a non-standard rdf container.

And in the end, it's all just links. with a bit of convenience food.

Axel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.