You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jochen Topf <jo...@remote.org> on 2002/11/19 10:16:27 UTC

HTML mangling and XML

Hi!

I am using Embperl-2.0b8. I am feeding (X)HTML/Emberl-Code through a XSLT
stylesheet. This works well until I have some forms in my HTML code and
Embperl mangels for instance <option> tags by adding a "selected" attribute.
The "selected" is not valid XML so the XSLT parses complains. I tried
setting the optDisable* flags, but it didn't work. Looking at the Changes
file this seems to be normal behaviour for some reason.

The best solution would be if Embperl always produces valid XML in these
cases. This should work with all the old browsers if done properly.

The other solution for me would be to switch of the HTML mangling, but then
I would have to do all the mangling myself.

btw: A very similar problem. In some non-reproducable cases Embperl modified
a URL in a link which contained something like
"http://www.example.org/foo.html?x=y" to
"http://www.example.org/foo.html?x=y&" at which point the XSLT parser
complained because of the unescaped & in there.

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: HTML mangling and XML

Posted by Gerald Richter <ri...@ecos.de>.
> > > I am using Embperl-2.0b8. I am feeding
> > > (X)HTML/Emberl-Code through a XSLT
> > > stylesheet. This works well until I have some forms
> > > in my HTML code and
> > > Embperl mangels for instance <option> tags by adding
> > > a "selected" attribute.
> > > The "selected" is not valid XML so the XSLT parses
> > > complains. I tried
> > > setting the optDisable* flags, but it didn't work.
> > > Looking at the Changes
> > > file this seems to be normal behaviour for some
> > > reason.
> >

optDisable* are no longre supported in Embperl 2 (see README.v2), instead
change the syntax to EmbperlBlocks, this will leave your HTML
 alone.

Either put

[$ syntax EmbperlBocks $]

 at the top of your file or

Embperl_Syntax EmbperlBlocks

in your httpd.conf

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: HTML mangling and XML

Posted by Jochen Topf <jo...@remote.org>.
On Tue, Nov 19, 2002 at 08:19:55AM -0800, Jarrod Stenberg wrote:
> > I am using Embperl-2.0b8. I am feeding
> > (X)HTML/Emberl-Code through a XSLT
> > stylesheet. This works well until I have some forms
> > in my HTML code and
> > Embperl mangels for instance <option> tags by adding
> > a "selected" attribute.
> > The "selected" is not valid XML so the XSLT parses
> > complains. I tried
> > setting the optDisable* flags, but it didn't work.
> > Looking at the Changes
> > file this seems to be normal behaviour for some
> > reason.
> 
> This is not really an Embperl problem.  Your XML,
> whether it's straight up XML, XHTML, XSL or whatever
> must be compliant.  Adjusting the processor to
> accomodate the operator defeats a main objective of
> the XML recommendation.  

But of course it is an Embperl problem, because it is not me, but Embperl
putting in the invalid stuff. I know about all the XHTML rules and follow
them but Embperl isn't. Embperl changes HTML pages behing my back, that
is the whole problem. This is one of the nice features of Embperl that it
is doing this, but in this case it leads to the problems I described.

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: HTML mangling and XML

Posted by Jarrod Stenberg <sl...@yahoo.com>.
> 
> I am using Embperl-2.0b8. I am feeding
> (X)HTML/Emberl-Code through a XSLT
> stylesheet. This works well until I have some forms
> in my HTML code and
> Embperl mangels for instance <option> tags by adding
> a "selected" attribute.
> The "selected" is not valid XML so the XSLT parses
> complains. I tried
> setting the optDisable* flags, but it didn't work.
> Looking at the Changes
> file this seems to be normal behaviour for some
> reason.

This is not really an Embperl problem.  Your XML,
whether it's straight up XML, XHTML, XSL or whatever
must be compliant.  Adjusting the processor to
accomodate the operator defeats a main objective of
the XML recommendation.  

This should be changed to either:
<option selected="1"/>
Or:
<option>
<xsl:attribute name="selected">1</xsl:attribute>
</option>

> btw: A very similar problem. In some
> non-reproducable cases Embperl modified
> a URL in a link which contained something like
> "http://www.example.org/foo.html?x=y" to
> "http://www.example.org/foo.html?x=y&" at which
> point the XSLT parser
> complained because of the unescaped & in there.

Use &amp; instead of just &.  When it finds a &, it
expects it to be an entity: &somevalue;  

-Jarrod

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org