[MKDoc-dev] [1.6 bug] Using self/parent/parent for detecting where one is in the document hierarchy

Bruno Postle bruno at mkdoc.com
Tue Feb 28 13:36:13 GMT 2006


Chris Croome wrote:
> 
> I know this should work but it doesn't seem to -- for example try this
> code in a document:

Re-read my email.

If an object or document possibly doesn't exist, you have to test 
for its existence before trying to access methods.

This assumes that self/parent exists:

   <div
   petal:condition="true:  self/parent/parent;
                    false: self/parent/parent/parent;"
   >

This code makes no assumptions:

   <div
   petal:condition="true:  self/parent;
                    true:  self/parent/parent;
                    false: self/parent/parent/parent;"
   >

-- 
Bruno


More information about the MKDoc-dev mailing list