Ok, let's recap.

Here's the code you quoted:

   x2jDefn_nifxml_
1 : 0
  for_i. <;._2 (0 : 0) do.
    'nm df'=. ':=' splitstring >{.'NB.' splitstring >i
    'mn dy'=. dltb each 2 {. ' : ' splitstring df
    nm=. dltb nm
        if. 0=#dy do. nm x2jChar (3 : mn)
    elseif. 0=#mn do. nm x2jElm  (4 : dy)
    elseif.       do. nm x2jElm  (3 : (mn;':';dy)) end.
  end.
  i.0 0
)

   'Items'x2jDefn_nifxml_
/        := Result : Result=: ''
compound := cEnd y : x cStart y
add      := aEnd y : x aStart y
add      := aChr y
)

The consequence of executing this code is something like this:

'/' x2jElm (3 : 0)
  Result
:
  Result=: ''
)

'compound' x2jElm (3 :0)
  cEnd y
:
  x cStart y
)

'add' x2jElm (3 :0)
  aEnd y
:
  x aStart y
)

'add' x2jChar (3 :0)
  aChr y
)

Put differently, the x2jElm code runs for the specified elements. The
monadic definition runs for the close of the element and the dyadic
definition runs for the opening element. The '/' gives basically the same
effect as a startDocument/endDocument pair.

Meanwhile, the x2jChar code gets the characters inside the element (inside
the <add> element, in this case).

Does that help? Or am I missing your question?

Thanks,

-- 
Raul

On Wed, Feb 12, 2014 at 4:11 PM, Brian Schott <schott.br...@gmail.com>wrote:

> It looks like I get the same paths as you, but I don't know what version of
>  xml is being used.
>
>    copath'nifxml'
> +----+----+------+-+
> |px2j|psax|pexpat|z|
> +----+----+------+-+
>    9!:14''
> j602/2008-03-03/16:45
>
> I do NOT get the problem if I use _px2j_ .
> But I still do not understand what this part of the code is accomplishing.
>
> Thanks,
>
> On Wed, Feb 12, 2014 at 3:22 PM, Raul Miller <rauldmil...@gmail.com>
> wrote:
>
> > Hmm...
> >
> > x2jDefn is defined in the px2j locale which is defined by the statement
> > require 'sax/xml/x2j'
> >
> > So what I had meant to paste into my message was:
> >    x2jDefn_px2j_
> >
> > Meanwhile, nifxml was the locale which I had defined, and it inherits
> from
> > px2j, as you can see here:
> >    copath'nifxml'
> > +----+----+------+-+
> > |px2j|psax|pexpat|z|
> > +----+----+------+-+
> >
> > So hopefully that makes that issue a little clearer.
> >
> > But I am not sure how you got that error. I cannot reproduce it.
> >
> > Which version of J are you using, and are the addons up-to-date?
> >
> > Thanks,
> >
> > --
> > Raul
> >
> >
> >
> >
>
> --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to