[Petal] Multiple conditions?

Ronald Hayden rhayden at apple.com
Mon Mar 10 14:52:28 GMT 2003


On Sunday, March 9, 2003, at 03:01  PM, jhiver at mkdoc.com wrote:

>> <page petal:set="chapters $book/chaptersContainingNamedDescendants
>> 'Figure' 'CodeListing' 'Table'"
>
> Personally I'd remove the $ and use double dashes, but that's a matter
> of taste and after all you might want to stick with the conventions 
> you've
> already set.

Hmm I would find the double-dashes confusing here.  To me it means 
"command-line switch", which implies that the true value is supposed to 
*follow* it (such as --Figure 'Name') while 'Figure' communicates to me 
that I'm just passing this as a string parameter...  However for any 
examples I'd be happy to use the -- approach.


>> <chapter_title internal-destination="$chapter/page_ref"
>> petal:content="structure $chapter/name"></chapter_title >
>
> The strength of Petal is that you can use dummy values everywhere...
> if your designers use WYSIWYG tools, the following will probably
> work better:
>
> <chapter_title
>     internal-destination="dummy_internal_destination"
>     petal:attributes="internal-destination chapter/page_ref"
>     petal:content="structure chapter/name">Dummy Chapter</chapter>
>
> One of the advantages of using petal:attributes is that if the 
> expression
> evaluates to undef or empty string, the attribute is removed, which is
> almost always what you want.

Ah, good to know.  I hadn't really looked at petal:attributes.  So far 
all the attributes I've been dealing with are required, so I'm just as 
happy to avoid the indirection.  But it'll no doubt be necessary to 
take the attributes approach for many things.

At this point we're not using WYSIWIG editors for this stuff, so the 
dummy content feature hasn't really played into things.  But for 
examples it's the way to go.

Clearly we both feel strongly about aesthetics, but have slightly 
different preferences!  Well, that's good for the tool.

  -- Ron




More information about the Petal mailing list