Re: Crossreferencing
From: Tony Graham <tgraham@mulberrytech.com>
Date: Thu, 27 Mar 1997 21:42:24 0500 (EST)
Paul Prescod writes:
> Here is the change:
>
> > (element THEOREM
> > (make paragraph
>
> (withmode theorem (processelementwithid))
> (processchildren)))
The way I read Matthias's post, the withmode should be on the proof,
which is the element with the IDREF attribute.
For the sample DTD and document:

<!DOCTYPE test [
<!* TEST *>
<!ELEMENT test   ((proof  theorem)*) >
<!* PROOF OF A THEOREM *>
<!ELEMENT proof   (#PCDATA) >
<!ATTLIST proof
of IDREF #REQUIRED >
<!* THEOREM *>
<!ELEMENT theorem   (#PCDATA) >
<!ATTLIST theorem
id ID #REQUIRED >
]>
<test>
<theorem id="theorem1">The earth is flat</theorem>
<theorem id="theorem2">The stork didn't really bring me</theorem>
<proof of="theorem2">If the stork brought me, I wouldn't need this
belly button</proof>
<proof of="theorem1">Someone told me</proof>
</test>

the following Jade stylesheet appears to solve the problem:

<!doctype stylesheet PUBLIC "//James Clark//DTD DSSSL Style Sheet//EN">
;; Sample code in response to "Crossreferencing" post by Matthias Clasen
(element TEST
(make simplepagesequence))
(element THEOREM
(make paragraph
(make sequence
(literal
(stringappend
"Theorem "
(number>string (childnumber))
". "))
(processchildren))))
(element PROOF
(make paragraph
(make sequence
(withmode theorem
(processelementwithid
(attributestring "OF")))
(processchildren))))
(mode theorem
(element THEOREM
(literal
(stringappend
"Proof of "
(number>string (childnumber))
": "))))

The crossreferencing problem that gets me is how, in the absence of
elementwithid, do you support an linking element such as the HTML <A>
element that has content and the content is (one end of) the link to
the referenced element. The only uses of the link flow object class
that I have seen use the same withmode and processelementwithid
combination as in this example, which does not preserve the content of
the linking element.
Regards,
Tony Graham
=======================================================================
Tony Graham, Consultant
Mulberry Technologies, Inc. Phone: 3012316931
6010 Executive Blvd., Suite 608 Fax: 3012316935
Rockville, MD USA 20852 email: tgraham@mulberrytech.com
=======================================================================
