Re: Accessing declared value of attribute in Jade

Subject: Re: Accessing declared value of attribute in Jade
From: James Clark <jjc@xxxxxxxxxx>
Date: Tue, 07 Oct 1997 09:53:35 +0700
Daniel Speck wrote:
> 
> James Clark wrote:
> >
> > Daniel Speck wrote:
> >
> > > I have run into a problem that I can't seem to solve. For each element
> > > in the instance I need to find the declared value of each non-implied
> > > attribute and if it is ENTITY or ENTITIES, I need to do further
> > > processing to obtain the external identifier(s) and notation(s). The
> > > problem I am having is that I can find no way to obtain information
> > > about the declared value of an attribute. Can anyone tell me how?
> >
> > You can't find get the declared value of an attribute, but your problem
> > is just to find whether an attribute is an ENTITY or ENTITIES attribute,
> > right? You can do this by looking at the entity property on the
> > attribute value token node in the value of the attribute.
> >
> 
> Okay, I still can't seem to get to the "attribute value token node" in
> the value
> of the attribute. I created a small test SGML instance:
> 
> <!DOCTYPE test [
> <!ELEMENT test o o (graphic+)>
> <!ELEMENT graphic - o EMPTY>
> <!ATTLIST graphic
>           name ENTITY #implied
> >
> <!NOTATION tiff SYSTEM "tiff">
> <!ENTITY foo SYSTEM "foo.tif" NDATA tiff>
> ]>
> <graphic name=foo>
> 
> and a small DSSSL style spec:
> 
> <!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style
> Sheet//EN">
> 
> (define debug
>   (external-procedure "UNREGISTERED::James Clark//Procedure::debug"))
> 
> (element (graphic)
>   (let* ((node (current-node))
>          (attlist (attributes node))
>          (nameatt (debug (named-node "name" attlist)))
>          (nameval (debug (node-property "value" nameatt)))
>          ; The next line doesn't work. Jade just says:
>          ;   jade:attr.dsl:11:19:E: no value for node property
> "attvaltk"
>          ; I can't seem to get to the "attribute value token node" in
> the
>          ; value of the attribute
>          (attvaltk (debug (node-property "attvaltk" nameval)))

"attvaltk" is the name of the class of the node, not the name of a
property.  When an attribute value is not CDATA, the "value" property
consists of a list of nodes of class "attvaltk".  When the declared
value is ENTITY or ENTITIES, each of these nodes of class "attvaltk"
have an "entity" property.

James


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


Current Thread