That is a bug indeed. One of our major goals is to plug off
the xmerl as a template processor (it is slow, heavy and has
oversized structures): the first step was to remove its dependency
from the wtype's (the modules responsible for formatting and 
validation). 

Everything works well as long as wtype returns a plain text (type of 
the returning structure is 'text', not 'cdata'). Unfortunately, there
is only one place where we actually break the convention and change 
the returning type: wtype_html. 

As a workaround I have prepared a little patch for wpart_include 
(the second place where the changes took place is wpart_lookup - 
it also uses 'format' attribute for changing the display of the 
data). A quick fix introduces a new attribute to wpart_include 
(wpart_lookup has it since 1.2.1): 'type'. 

In case 'type' is set to 'cdata' the data is rendered as it was
an HTML part of the document. Otherwise, all characters are printed
out (e.g. > is encoded to >).

The patch has been commited to the bitbucket's repository 
(changeset 70bc68ef8b93: 
http://bitbucket.org/etc/erlang-web/changeset/70bc68ef8b93/)

Thank you for pointing out the inconsistency.

----- "Michael McDaniel" <erlang...@autosys.us> wrote:

> I am happy to be able to contribute.  I installed 1.3RC1 on
>  http://trip.autosys.us and found that a change in
>  lib/wparts-N/wpart_include.erl causes breakage of stylesheet
>  includes, e.g. using
> 
>   <wpart:include file="templates/trip/style.css" format="html" />
> 
>  causes style information to show up as plain text using 1.3RC1.
>  Using 1.2.1 and the style information would affect the page
>  style as desired.
> 
> 
>  Here is the change ...
> 
> 
> < is from wparts-1.2.1
> > is from wparts-1.3
> 
> 39c38,39
> <       wpartlib:format(#xmlText{value = Tpl}, E);      %% STYLIN'
> ---
> >       #xmlText{value = wpartlib:format(Tpl, E)};      %% PLAIN TEXT
> 
> 
> 
>  I did not make a patch because I do not know why the change was
>  made.  
> 
>  Is there some other recommended way of including a stylesheet ?
>  (for now, I have changed my local code so the includes work)
> 
> 
> 
> ~M

-- 
Michal Ptaszek
www.erlang-consulting.com

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Erlangweb-users mailing list
Erlangweb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
http://www.erlang-web.org/

Reply via email to