Re: I don't know how....

Subject: Re: I don't know how....
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Mon, 25 Oct 1999 15:41:12 -0500
Quoting Frank A. Christoph <christo@xxxxxxxxxxxxxxxxxx>:
> > Hello, I have a problem. I have a SGML like this:
> >
> > <!doctype EINBAU SYSTEM "MTU_DEMO.dtd"> <?MADDR:MTU_DEMO\Anbau\011.10
> > FixVSchrEntw\4000\Deutsch>
> > <EINBAU>
> > <ARBGRP-EIN>
> > 	...
> > 	...
> > 	...
> > </ARBGRP-EIN>
> > </EINBAU>
> >
> > I want to take the line  "<?MADDR:MTU_DEMO\Anbau\011.10
> > FixVSchrEntw\4000\Deutsch>" but I don't know why.
> >
> This is a good question, and I guess I'd like to know the answer too. The PI
> above is not in the prolog, right? But it appears before the document
> element, and the document-element property of an sgmldoc can only be an
> element, not a PI. So maybe what you have to do is something like this:
> 
>   (node-property 'system-data (node-list-first (select-by-class (rsiblings
> doc-elem) 'pi)))
> 
   Actually, at least for purposes of the grove, anything that comes
before the document element is part of the prolog.  Conveniently, the
sgml-document class has a subnode property, "prolog", which contains
such items.  So, with just a slight twist on your expression:

     (define (grove-root) (node-property 'grove-root (current-node)))
     (node-property 'system-data (node-list-first (select-by-class
       (node-property 'prolog (grove-root)) 'pi)))

we're in business.  I believe the definition for (grove-root) is only
needed with pre-1.3 versions of Jade.
   The problem with (rsiblings), in this case, is that it only returns
the siblings of the given node which have the same origin-to-subnode
relationship.  In this case, that would be document-element, which, as
you said, can only contain a single element.

-Brandon :)


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread