You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Juan Carlos Fernandez Caballero <fe...@gmail.com> on 2007/07/16 13:46:46 UTC

Show text file with Forrest

Hello,

A have a problem with Forrest. A need show (load) a text file. I could to
paste the text in a image and use:

<p><img src="images/prueba.jpg" alt="Prueba"/></p>

I believe that this is not the orthodox way but to do it. Can I use the text
file of direct way?


Thanks!!!!


-- 
Juan Carlos Fernández Caballero.
Dpto. de Informática y Análisis Numérico.
Campus Univ. de Rabanales. Edificio "Einstein". 3ª planta, ala Norte.
Universidad de Córdoba. 14071 - Córdoba (Spain)

Tfn: 696 550 558
Email: fernandezcaballero@gmail.com

Re: Show text file with Forrest

Posted by David Crossley <cr...@apache.org>.
Thorsten Scherler wrote:
> Juan Carlos Fernandez Caballero wrote:
> > 
> > A have a problem with Forrest. A need show (load) a text file.
> 
> You mean you want to use a text file as input?
> 
> >  I could to paste the text in a image and use:
> > 
> > <p><img src="images/prueba.jpg" alt="Prueba"/></p>
> 
> Meaning you want to display the whole text file as image?
> 
> > I believe that this is not the orthodox way but to do it. Can I use
> > the text file of direct way?
> 
> Yeah, there is.
> 
> If you use POD format then you can use
> http://www.rblasch.org/projects/pod-input/.
> 
> Otherwise it should be easy to write an input plugin for text. 
> 
> Do you have an example file?

Juan, as you can see in this thread, Brolin has explained
that you can use xi:include and Thorsten has mentioned
some other techniques.

There is another option: Use "ASCII Art" to automatically
generate an image from text.

Add a file xdocs/text.aart

Add an image link to your xdoc source:
  <p>
   Text: <img src="text.png" alt="image"/>
  </p>

It would only be suitable for small snippets of text,
but this technique might be useful in some circumstances.

-David

Re: Show text file with Forrest

Posted by Brolin Empey <br...@gmail.com>.
David Crossley <cr...@apache.org> wrote:
> It got it working. See comments at
> https://issues.apache.org/jira/browse/FOR-1032

I have not forgotten about this issue.  I have just been busy with
other things recently.  Hopefully I can test your solution in the next
week or two.

Thanks,
Brolin

Re: Show text file with Forrest

Posted by David Crossley <cr...@apache.org>.
It got it working. See comments at
https://issues.apache.org/jira/browse/FOR-1032

The main changes were to use an xml entity to
declare the xmlns:xi attribute in the DTD and to
use the "cocoon:" protocol for the xi:include href.

There are some other changes, so see FOR-1032.

-David

Re: Show text file with Forrest

Posted by Brolin Empey <br...@gmail.com>.
David Crossley <cr...@apache.org> wrote:
> You are not providing sufficient information to enable us
> to help you.
>
> Please open a new issue in our issue tracker. Then attach example
> files: your new DTD, your project XML Catalog, a cut-down example
> of your index.xml file.

Done. See https://issues.apache.org/jira/browse/FOR-1032

Brolin

Re: Show text file with Forrest

Posted by David Crossley <cr...@apache.org>.
Brolin Empey wrote:
> Ross Gardler wrote:
> >
> >To make Jim's DTD work you need to make Forrest aware of it, this is
> >documented at http://forrest.apache.org/docs_0_80/your-project.html#new_dtd
> 
> I know this.  How do you think I got validation of document-v20-jd.dtd
> to fail if Forrest is unaware of it? :P
> 
> Anyway, I did make some more progress after rereading the docs you linked 
> to. :)
> 
> http://forrest.apache.org/docs_0_90/validation.html says "This custom
> DTD should be placed in your project resources directory at
> src/documentation/resources/schema/dtd/".
> 
> However, my document-v20-jd.dtd was in schema/.  I did not have a 
> schema/dtd/.
> 
> I created schema/dtd/ and moved document-v20-jd.dtd into it.

It doesn't matter where the DTD is located. The important thing
is that your project's XML Catalog refers to it properly and
that you use the new Public Identifier in your source xml file.

>  Now
> validation succeeds, until I try using an <xi:include> element in my
> XDocs source file.  This causes validation to fail again:
> 
> validate-xdocs:
> /home/brolin/WEB/techsol.ca/forrest/src/documentation/content/xdocs/products/index.xml:34:74:
> Element type "xi:include" must be declared.
> /home/brolin/WEB/techsol.ca/forrest/src/documentation/content/xdocs/products/index.xml:34:74:
> The prefix "xi" for element "xi:include" is not bound.
> 
> I wonder if this is caused because I am using document-v20-jd.dtd in
> my Forrest project instead of installing document-v20-jd.dtd in the
> same place as document-v20.dtd in my Forrest installation.
>
> Jim does not say how he installed his new DTD file in his post.
> 
> I would prefer to keep document-v20-jd.dtd in my Forrest project so
> that it can be kept under version control.  Keeping it in my project
> also makes it easier for someone else who checks out a working copy of
> my Forrest site, since they get all the needed files in the checkout
> and do not need to modify their local Forrest installation.

It should work in the project space. This is why we make this
facility available.

However, because you are trying to intercept one of the main DTDs
and essentially re-define it, this might cause some troubles.

> >A better solution would be to patch our DTD with Jims proposed changes.
> 
> I would like to get my method working before I try to patch the Forrest DTD.

You are not providing sufficient information to enable us
to help you.

Please open a new issue in our issue tracker. Then attach example
files: your new DTD, your project XML Catalog, a cut-down example
of your index.xml file.

-David

Re: Show text file with Forrest

Posted by Brolin Empey <br...@gmail.com>.
Ross Gardler <rg...@apache.org> wrote:
> To make Jim's DTD work you need to make Forrest aware of it, this is
> documented at http://forrest.apache.org/docs_0_80/your-project.html#new_dtd

I know this.  How do you think I got validation of document-v20-jd.dtd
to fail if Forrest is unaware of it? :P

Anyway, I did make some more progress after rereading the docs you linked to. :)

http://forrest.apache.org/docs_0_90/validation.html says "This custom
DTD should be placed in your project resources directory at
src/documentation/resources/schema/dtd/".

However, my document-v20-jd.dtd was in schema/.  I did not have a schema/dtd/.

I created schema/dtd/ and moved document-v20-jd.dtd into it.  Now
validation succeeds, until I try using an <xi:include> element in my
XDocs source file.  This causes validation to fail again:

validate-xdocs:
/home/brolin/WEB/techsol.ca/forrest/src/documentation/content/xdocs/products/index.xml:34:74:
Element type "xi:include" must be declared.
/home/brolin/WEB/techsol.ca/forrest/src/documentation/content/xdocs/products/index.xml:34:74:
The prefix "xi" for element "xi:include" is not bound.

I wonder if this is caused because I am using document-v20-jd.dtd in
my Forrest project instead of installing document-v20-jd.dtd in the
same place as document-v20.dtd in my Forrest installation.

Jim does not say how he installed his new DTD file in his post.

I would prefer to keep document-v20-jd.dtd in my Forrest project so
that it can be kept under version control.  Keeping it in my project
also makes it easier for someone else who checks out a working copy of
my Forrest site, since they get all the needed files in the checkout
and do not need to modify their local Forrest installation.

> A better solution would be to patch our DTD with Jims proposed changes.

I would like to get my method working before I try to patch the Forrest DTD.

Thanks,
Brolin

Re: Show text file with Forrest

Posted by Ross Gardler <rg...@apache.org>.
Brolin Empey wrote:
> Ross Gardler <rg...@apache.org> wrote:
>> Anyway, can you provide a link to the post you refer to
> 
> http://www.mail-archive.com/user@forrest.apache.org/msg02812.html

[Forrest is a community and you should not address individual community 
members as you originally did with the above post being sent to Jim 
alone. Always post to the community as a whole. No single member of our 
community has the time to support individual users.]

To make Jim's DTD work you need to make Forrest aware of it, this is 
documented at http://forrest.apache.org/docs_0_80/your-project.html#new_dtd

A better solution would be to patch our DTD with Jims proposed changes. 
This would add the functionality to Forrest itself and therefore would 
not require other users who follow to figure this out. Jim has shown the 
way forward in the thread you link to in your original post, if you 
could add this to our DTD as he suggests and provide a patch we'd be 
happy to add it to Forrest.

Ross

Re: Show text file with Forrest

Posted by Brolin Empey <br...@gmail.com>.
Ross Gardler <rg...@apache.org> wrote:
> Anyway, can you provide a link to the post you refer to

http://www.mail-archive.com/user@forrest.apache.org/msg02812.html

Thanks,
Brolin

Re: Show text file with Forrest

Posted by Ross Gardler <rg...@apache.org>.
On 17/07/07, Brolin Empey <br...@gmail.com> wrote:
> Where are Ross Gardler and David Crossley when one needs them? :P
> I see they are still active on the dev list.  Maybe I should try
> resending my post to the dev list.  Or maybe they will read this post
> and decide to reply (hint, hint!). :)

I was getting very drunk with a great many new and wonderful people
(including Andrew Savory, who many here will know from the Cocoon list
 - oh, and we facilitated a workshop session together but that's much
less interesting, not to mention fun)

Anyway, can you provide a link to the post you refer to, maybe I'll
find the time to take a look, although I have to catch up with the
last three days of lost work too ;-) so maybe someone else can help
before me (and David is on holiday so you've no chance there ;-)

Ross

Re: Show text file with Forrest

Posted by Thorsten Scherler <th...@apache.org>.
On Tue, 2007-07-17 at 09:02 -0700, Brolin Empey wrote:
> Thorsten: I think Juan is looking for an include directive in order to
> include the contents of a text file in multiple Forrest source files.

woo hoo, are you Juan? 

If so, respect Brolin for this perfect shoot in the dark. ;)

> 
> I think this is possible with XInclude, but no one has replied to my
> post about using XInclude with Forrest 0.8. :(

Will have a look at your post again.

> 
> Where are Ross Gardler and David Crossley when one needs them? :P
> I see they are still active on the dev list.  Maybe I should try
> resending my post to the dev list.  Or maybe they will read this post
> and decide to reply (hint, hint!). :)

So I and everybody else will not need to reply, right?

We are all very busy this day (e.g. David is on vacation and Ross traveling) and this list is good as gold for this posts. 

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Re: Show text file with Forrest

Posted by Brolin Empey <br...@gmail.com>.
Thorsten: I think Juan is looking for an include directive in order to
include the contents of a text file in multiple Forrest source files.

I think this is possible with XInclude, but no one has replied to my
post about using XInclude with Forrest 0.8. :(

Where are Ross Gardler and David Crossley when one needs them? :P
I see they are still active on the dev list.  Maybe I should try
resending my post to the dev list.  Or maybe they will read this post
and decide to reply (hint, hint!). :)

Brolin

Re: Show text file with Forrest

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Mon, 2007-07-16 at 13:46 +0200, Juan Carlos Fernandez Caballero
wrote:
> Hello,
> 
> A have a problem with Forrest. A need show (load) a text file.

You mean you want to use a text file as input?

>  I could to paste the text in a image and use:
> 
> <p><img src="images/prueba.jpg" alt="Prueba"/></p>

Meaning you want to display the whole text file as image?

> 
> I believe that this is not the orthodox way but to do it. Can I use
> the text file of direct way?

Yeah, there is.

If you use POD format then you can use
http://www.rblasch.org/projects/pod-input/.

Otherwise it should be easy to write an input plugin for text. 

Do you have an example file?

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions