(dsssl) Re: (dsssl) How to make a RTF styles-sheet with DSSSL?

Subject: (dsssl) Re: (dsssl) How to make a RTF styles-sheet with DSSSL?
From: Javier Farreres de la Morena <spanish@xxxxxxxxx>
Date: Sat, 9 Mar 2002 12:40:55 +0100
Some suggestions on this topic. I hope they are not too much out or reason.
(some are indeed I think)

>Here are the information contained in a SGML file:
>
><documentinfo>
>  <property name="title" value="MY HOLIDAYS" />
>  <property name="author" value="Jean Emar" />
>  <property name="operator" value="Emar composition" />
>  <property name="creationTime" value="Fri, 11 Jan 2002 15:41:00 CET"
>/>
>  <property name="revisionTime" value="Fri, 11 Jan 2002 15:41:00 CET"
>/>
>  <property name="editingMinutes" value="0" />
>  <property name="numberOfPages" value="1" />
>  <property name="numberOfWords" value="40327" />
>  <property name="numberOfChars" value="229869" />
></documentinfo>

As you explain later you obtain this markup by processing the RTF files
from your collaborators. This markup is clearly not the best that could
be thought of. If you could enhance it a bit, you would have a better life
processing it afterwards. For example, why not include the property elements
as an attribute of document info whith the name of the name attribute, and
as value the value attribute of the property? Or why not convert the property
element into title, author and such elements? This would allow you to define
a governing DTD.
This is not really important here but in another example provided by you
below it turns out really important:

>For example, I have a paragraph defined by:
><par>some text</par>
>And I wish to produce a RTF paragraph with black border. How can I do
>that?
>
>My problem is more complex. In fact, I have a title and some paragraph
>to group in one box:
><par>Normal paragraph without box</par>
><par type="title">A TITLE in the box</par>
><par type="box">paragraph 1 in the box</par>
><par type="box">paragraph 2 in the box</par>
><par type="box">paragraph 3 in the box</par>
><par>Normal paragraph without box</par>
>How can I group the title and the three paragraphs in a single box with
>black borders?

This is here where the problem comes. This markup means nothing, as everything
is a par element, and noone assures you that all box elements end up together.
Also, does each par box have a box alone of they are grouped together in
the same box? The GOOD markup would be:

><par>Normal paragraph without box</par>
<box>
><type>A TITLE in the box</title>
><par>paragraph 1 in the box</par>
><par>paragraph 2 in the box</par>
><par>paragraph 3 in the box</par>
</box>
><par>Normal paragraph without box</par>

And obtaining this markup from the source you have provided before is an
easy matter with a good transformation tool. And again, it will allow you
to define a governing DTD.
Bad luck for you, DSSSL transformation language would do it for you, but
it is not yet implemented for OpenJade.
I know of an utility called OmniMark that does this and many many more things
but you have to pay for it, although it is really very good. I have also
heard about something called Balisse I think, but never used it.
If you can enhance your markup, your live will become really easy.

>Do you have Web sites to advise me?

I suggest you the tutorials by Daniel M. German (Dunno where) and Paul Prescod
(www.prescod.net). In the James Clark (www.jclark.com) site you can find
them referenced, but the references are wrong now.

>I am generating RTF documents from an SGML file.
>Does anyone can give me examples to make box flow object?

Well, for the markup you use it can be complicated. You would need the query
feature to obtain all the par element with type set to title, followed by
several par elements which are together and have the attribute type to box,
and process all of them with a single style rule but it is not yet implemented
in OpenJade, as long as I know. This query would best be implemented with
node regexp expressions, which are also not implemented in OpenJade. If
you could enhance your markup, then it would be an easy matter to do what
you want, as you would make a box out of the box element.

Anyway I must say that in my oppinion this is perverting the use of SGML.
You should strive to mark up the meaning of your information, not the format
of it. I mean, what is codifying this box? This is the important thing.
I suppose it is not affordable to convert the work of your external collaborators
to using SGML as their base tools, rather than Word and RTF format. But
if you have a governing DTD defined by you, their work and yours would be
much easier altogether.





-------------------------------------------------------------
 ¡ Ahora GANA VIAJES
navegando GRATIS con Tiscali !
 SÓLO HASTA EL 31 DE ENERO
 http://ganaviajes.tiscali.es/?did=EMA-5300002
-------------------------------------------------------------





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

Current Thread