Re: node-property

Subject: Re: node-property
From: Richard Light <richard@xxxxxxxxxxxxxxxxx>
Date: Mon, 28 Jul 1997 22:39:07 +0100
In message <33DCCEBF.EB6A72BF@xxxxxxxxxxxxxxxx>, Paul Prescod
<papresco@xxxxxxxxxxxxxxxx> writes
>I wanted to explore node-property a little, and had some good luck with
>it, and some bad luck. I was successful in getting at the entities in a
>document, but not the elements. It looks to me like this program should
>print out the number of elements declared in an SGML document's DTD (is
>that right?):
>
><!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style
>Sheet//EN">
>(root 
>  (make simple-page-sequence
>   (make paragraph
>    (literal 
>         (number->string
>                (node-list-length
>                    (node-property "elements" (current-node))))))))
>
>But it always prints out 0. Any ideas?

As I read it, you are fighting a losing battle.  DSSSL-O seems to be
carefully constructed so that you cannot get at DTD information like
element declarations.  Although the '(root' construction rule gives you
access to the sgml-document node, the commands you are then allowed to
use limit you to element-type nodes within the document instance. 

For example, the rubric for '(process-children)' quite explicitly says:
"When the current node is of class 'sgml-document', the value of the
'document-element' property is treated as being the children of the
node." In other words, don't try getting at the prolog!

Or am I wrong?  (I would be delighted if I were!)

Richard Light
SGML and Museum Information Consultancy
richard@xxxxxxxxxxxxxxxxx
3 Midfields Walk 
Burgess Hill
West Sussex RH15 8JA
U.K.
tel. (44) 1444 232067

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


Current Thread