On Wed, Sep 10, 2008 at 2:38 PM, Chito Jovellanos <[EMAIL PROTECTED]> wrote:
> Does anyone have the elements for a utility that measures the 'depth' of a
> field tag eg, given an XML doc sample?
Assuming you have well formed xml, you could do something like this:
tag0=: I.'<' = xml
tag1=: I.'>'= xml
end0=: ('!'=xml{~1+tag0) +. '/'=xml{~_1+tag1
end1=: '/'=xml{~1+tag0
adj=: 1 - end0 + 2*end1
level=: +/\adj
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm