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 Axel, > > Thanks for this, > >> 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. > > > No but it will allow me to test whether a resource has the property of > 'my:Container' rather than just the generic 'rdf:Seq'. It just seemed to > make more sense semantically. > >> 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. > > > If I use the following RDF the tree doesn't build: > > <my:Container rdf:about="level1" my:name="Parent"> > <rdf:instanceOf > rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/> > <rdf:li rdf:resource="level2"/> > </my:Container> > > <my:Container rdf:about="level2" my:name="Child"> > <rdf:instanceOf > rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/> > <rdf:li rdf:resource="level3"/> > </my:Container> > > If I swap the 'my:Container' class for 'rdf:Seq' it builds fine. > > I take it this is what you mean by: > > > Mixing rdf:li with other parents is likely to achieve brokeness. > > So in theory at least, how does the tree consider an assertion a container? By standard means, it will assume that any arc of the form rdf:_1, rdf_2, etc is a containment arc. Those are generated automatically by rdf:li, but only in a RDF container environment. See your debugging (works this way, but not the other way around). You can add other arcs by using the containment attribute on the template. http://xulplanet.com/references/elemref/ref_XULElement.html#attr_containment > >> There is no such thing as a non-standard rdf container. > > > As in rdf:Seq, rdf:Bag, rdf:Alt Yes, those are the standard ones. Axel