You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Albert Cervera Areny <in...@sedifa.com> on 2002/07/12 16:48:16 UTC

html entities and xsl

Hi,
  I suppose this is a usual question but i've not been able to find its
  answer so far... how can I use html entities inside an xsl?... In fact I
  have an html file (not created by me) in which I have to insert dynamic
  information which cocoon will generate. The thing is thus that I'd like
  to leave the html (not xhtml thow i've converted into it) file untouched
  and insert data inside...  Any easy solutions? or at least... dose somebody know how to resolve the
  entities problem?
  Thanks in advance!



-- 
Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: html entities and xsl

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Andrew C. Oliver [mailto:acoliver@apache.org]
> 
> This sounds pretty specialized in one way and generic in another.  The
> problem being is that the insertion point is
> content specific.  Meaning you'll need to at least insert some kind of
> tag into the file.

Sometimes yes, and sometimes it is not necessary (it depends on your
content), see below...


>  From my limited understanding this is something that Velocity is
pretty
> good at (provided you insert some kind of velocity tag).

Inclusion is better way, it is native to Cocoon and you don't have to
include yet-another-not-so-small-library.


>  From my understanding Cocoon has a velocity generator that is nearly
> completely undocumented (but provided you could grok
> velocity (http://jakarta.apache.org/velocity/), I'm betting you could
> figure out the generator
>
(http://xml.apache.org/cocoon/userdocs/generators/velocity-generator.htm
l).

Yes, it has.


> A few alternatives come to mind off hand:
> 1. Write generators/transformers for cocoon that are content/style
> specific (which I bet you'll still have to put tags in the HTML)

Simple XSLT which adds include tag will suffice in most cases.


> 2. Find a way to use the Velocity generator and add the tags
> 3. Work with your content-management group (assumption) who maintains
> the HTML, come up with something that is XHTML based and perhaps
> transitional.  They'll gain some new skills that they may value, and
> you'll get something cleaner.  You could probably
> create a few not wonderful (from an achedemic standpoint) xml
> stylesheets that left you with seperation between your data and the
> (barely xsl) xhtml page without requiring them to become xsl geniuses
> overnight.  Basically have a big block of html with some xsl copy
> statements in it at the appropriate places.  Later you can move to
> greater seperation of data and style as the group picks up your
> xml/xsl skills.
> 
> Or thats my thinking.  Someone please step in and correct me if I'm
off
> base.

Regarding:

> >  have an html file (not created by me) in which I have to insert
dynamic
> >  information which cocoon will generate. The thing is thus that I'd
like
> >  to leave the html (not xhtml thow i've converted into it) file
untouched
> >  and insert data inside...  Any easy solutions? or at least... dose
somebody

The simplest, and well-known, and documented, and with lots of samples
way is sitemap aggregation.

You have your source page intact, and you add some dynamic content to
it. Post-process aggregated result with XSLT, and you are done.

Regarding entities, I believe that is something which can be handled by
entity resolution catalog. You will have to add DTD declaration to your
document though. See entity catalog demos and docs.


Vadim



> 
> thankse,
> 
> -Andy
> 
> Albert Cervera Areny wrote:
> 
> >Hi,
> >  I suppose this is a usual question but i've not been able to find
its
> >  answer so far... how can I use html entities inside an xsl?... In
fact I
> >  have an html file (not created by me) in which I have to insert
dynamic
> >  information which cocoon will generate. The thing is thus that I'd
like
> >  to leave the html (not xhtml thow i've converted into it) file
untouched
> >  and insert data inside...  Any easy solutions? or at least... dose
somebody
> >  know how to resolve the entities problem?
> >  Thanks in advance!


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: html entities and xsl

Posted by "Andrew C. Oliver" <ac...@apache.org>.
This sounds pretty specialized in one way and generic in another.  The 
problem being is that the insertion point is
content specific.  Meaning you'll need to at least insert some kind of 
tag into the file.

 From my limited understanding this is something that Velocity is pretty 
good at (provided you insert some kind of velocity tag).
 From my understanding Cocoon has a velocity generator that is nearly 
completely undocumented (but provided you could grok
velocity (http://jakarta.apache.org/velocity/), I'm betting you could 
figure out the generator 
(http://xml.apache.org/cocoon/userdocs/generators/velocity-generator.html).

A few alternatives come to mind off hand:
1. Write generators/transformers for cocoon that are content/style 
specific (which I bet you'll still have to put tags in the HTML)
2. Find a way to use the Velocity generator and add the tags
3. Work with your content-management group (assumption) who maintains 
the HTML, come up with something that is XHTML based and perhaps 
transitional.  They'll gain some new skills that they may value, and 
you'll get something cleaner.  You could probably
create a few not wonderful (from an achedemic standpoint) xml 
stylesheets that left you with seperation between your data and the 
(barely xsl) xhtml page without requiring them to become xsl geniuses 
overnight.  Basically have a big block of html with some xsl copy 
statements in it at the appropriate places.  Later you can move to 
greater seperation of data and style as the group picks up your
xml/xsl skills.

Or thats my thinking.  Someone please step in and correct me if I'm off 
base.

thankse,

-Andy

Albert Cervera Areny wrote:

>Hi,
>  I suppose this is a usual question but i've not been able to find its
>  answer so far... how can I use html entities inside an xsl?... In fact I
>  have an html file (not created by me) in which I have to insert dynamic
>  information which cocoon will generate. The thing is thus that I'd like
>  to leave the html (not xhtml thow i've converted into it) file untouched
>  and insert data inside...  Any easy solutions? or at least... dose somebody know how to resolve the
>  entities problem?
>  Thanks in advance!
>
>
>
>  
>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>