You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Rolf Kulemann <ma...@rolf-kulemann.com> on 2003/12/15 13:54:23 UTC

Problem with epozsave-xhtml.xsl

Hello,

while integrating my fallbacks for epoz and css I enconutered the
follwing (stupid) problem. The above xslt (should) looks like:


<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
 >


<xsl:template match="edit-envelope">
  <html>
    <xsl:copy-of select="original/xhtml:html/lenya:meta"/>
    <head>      
      <xsl:apply-templates select="edited/xhtml:html/xhtml:head/*"/>
    </head>
    <xsl:copy-of select="edited/xhtml:html/xhtml:body"/>
  </html>
</xsl:template>
...

In this constellation it does not work on my machine. So the header and
body of the "edited" tag are not captured, but the "original" meta
stuff. If I remove all xhtml: it works fine.

Can anybody tell me what the problem is? Attached you find the xml I
want to transform.

This can only be a stupid thing. (endorsed problem?)


-- 
Rolf Kulemann

Census Taker to Housewife: Did you ever have the measles, and, if so,
how many?


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA

Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Guido Wesdorp <gu...@infrae.com>.
Rolf Kulemann wrote:

>In my case, I only mean the namespace declaration, not the use of the
>namespace in tags. At the mom, it would be enough to leave the
>declaration in the doc when being saved.
>
>  
>
Right now that is not going to be easy. I was planning on adding a 
second type of filter that can be used to modify the resulting XML 
*string* rather than the DOM (so first Epoz will call all registered DOM 
filters and after that all registered string filters, this way e.g. XSLT 
can be used to filter the result without having to convert it from DOM 
to string and back), using that you could re-add the namespace 
declaration later on. I don't know if it would be a good idea to have 
the namespaces stuff placed back into the resulting XML, to be honest I 
think I'll encounter the same IE problems as with the namespaces on the 
tagnames.
If I get to check out the other namespaces issue I will (have to! ;) 
check out this one as well...

Cheers,

Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Tue, 2003-12-16 at 11:23, Guido Wesdorp wrote:
> Rolf Kulemann wrote:
> 
> > We can try to trigger Epoz not to remove the namespace stuff. (?)
> >
> Hmmm... I wonder how hard that's going to be... The implementation of 
> namespaces is a bit icky in browsers (mainly IE) but I'll see if I can 
> find something about how I can leave them in...

In my case, I only mean the namespace declaration, not the use of the
namespace in tags. At the mom, it would be enough to leave the
declaration in the doc when being saved.

Dunno, if this is possible. Would be nice.


-- 
Rolf Kulemann

In a five year period we can get one superb programming language.  Only
we can't control when the five year period will begin.


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Paul Everitt <pa...@zope-europe.org>.
The best answer for this, IMO, is to limit the JS cleanup to only 
provide well-formed output.  After that, cleaning out bogus elements 
etc. should be through client-side XSLT.  It is much better performance 
(especially on IE) and, likely, easier to customize.

--Paul

On Tuesday, Dec 16, 2003, at 11:40 Europe/Paris, Guido Wesdorp wrote:

> Guido Wesdorp wrote:
>
>>> We can try to trigger Epoz not to remove the namespace stuff. (?)
>>>
> I did a bit of testing and noticed there are indeed some nasty 
> differences between IE and Mozilla, I would need some time to find out 
> if IE can do it at all. If it isn't a large concern to you I would 
> like to wait until I have some time to spare, for us it's hardly an 
> issue, especially with the new filters, so I will create an issue 
> about it on our issuetracker to check it out later unless you decide 
> you really need it now...
>
> Cheers,
>
> Guido
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for 
> IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys 
> admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Epoz-development mailing list
> Epoz-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/epoz-development


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: Problem with epozsave-xhtml.xsl

Posted by Guido Wesdorp <gu...@infrae.com>.
Guido Wesdorp wrote:

>> We can try to trigger Epoz not to remove the namespace stuff. (?)
>>
I did a bit of testing and noticed there are indeed some nasty 
differences between IE and Mozilla, I would need some time to find out 
if IE can do it at all. If it isn't a large concern to you I would like 
to wait until I have some time to spare, for us it's hardly an issue, 
especially with the new filters, so I will create an issue about it on 
our issuetracker to check it out later unless you decide you really need 
it now...

Cheers,

Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: Problem with epozsave-xhtml.xsl

Posted by Guido Wesdorp <gu...@infrae.com>.
Rolf Kulemann wrote:

> We can try to trigger Epoz not to remove the namespace stuff. (?)
>
Hmmm... I wonder how hard that's going to be... The implementation of 
namespaces is a bit icky in browsers (mainly IE) but I'll see if I can 
find something about how I can leave them in...

Cheers,

Guido


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Tue, 2003-12-16 at 14:49, Michael Wechner wrote:
> Rolf Kulemann wrote:
> > On Mon, 2003-12-15 at 17:55, Michael Wechner wrote:
> > 
> >
> > 
> > 
> > I'm using the endorsed libs shipped with cocoon-2.1.2, so I'm using
> > Xalan 2.5.1.
> > 
> > I think we wait for a Epoz version not removing namespace. In the
> > meantime I propose to focus on Xalan-2.5.1's behavior?
> 
> To me it seems like Xalan-2.5.1 has some issues, whereas I never had 
> problems with Xalan-2.5.0
> 
> Would you mind trying once Xalan-2.5.0 ;-)

Of course, no prob.
But I propose to  make a note on the installation webpage and/or readme
about the Xalan-2.5.1 issues, because the install docu tells to copy the
endorsed libs from cocoon....

IMHO, we have to make Lenya running out of the box with Epoz,XHTML,
because that would accelerate *user incubation*, hehe.
I think so, because most of the users will start with a simple xhtml
doctype project so they will not use the *heavy weight doctypes*.


Next Epoz patch is pending....give me 30 mins. (added fallbacks and
customized css files)


-- 
Rolf Kulemann

Anybody with money to burn will easily find someone to tend the fire.


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Michael Wechner <mi...@wyona.com>.
Rolf Kulemann wrote:
> On Mon, 2003-12-15 at 17:55, Michael Wechner wrote:
> 
>
> 
> 
> I'm using the endorsed libs shipped with cocoon-2.1.2, so I'm using
> Xalan 2.5.1.
> 
> I think we wait for a Epoz version not removing namespace. In the
> meantime I propose to focus on Xalan-2.5.1's behavior?

To me it seems like Xalan-2.5.1 has some issues, whereas I never had 
problems with Xalan-2.5.0

Would you mind trying once Xalan-2.5.0 ;-)

Thanks

Michi

> 
> 


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Mon, 2003-12-15 at 17:55, Michael Wechner wrote:
> Rolf Kulemann wrote:
> > On Mon, 2003-12-15 at 15:49, Andreas Hartmann wrote:
> > 
> 
> >>The code inside the <original> element has the XHTML namespace,
> >>therefore it is matched by the XPath expression.
> >>The code inside the <edited> element has the default namespace,
> >>therefore it isn't matched.
> >>
> >>-- Andreas
> > 
> > 
> > I've just noticed it. Thank you.
> > The namespace is removed by Epoz.
> > I had implemented the above xsl without xhtml: ,but somebody inserted
> > the xhtml: back.
> 
> I did ;-)
> 
>   I wonder that saving worked with that xslt.
> > 
> > Michi: is it ok to use default namespace in the above xslt file?
> 
> without namespaces it didn't work in my case (I am using Xalan2.5.0).
> What Xalan version are you using?

I'm using the endorsed libs shipped with cocoon-2.1.2, so I'm using
Xalan 2.5.1.

I think we wait for a Epoz version not removing namespace. In the
meantime I propose to focus on Xalan-2.5.1's behavior?


-- 
Rolf Kulemann

Conway's Law:
	In any organization there will always be one person who knows
	what is going on.

	This person must be fired.


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Michael Wechner <mi...@wyona.com>.
Rolf Kulemann wrote:
> On Mon, 2003-12-15 at 15:49, Andreas Hartmann wrote:
> 

>>The code inside the <original> element has the XHTML namespace,
>>therefore it is matched by the XPath expression.
>>The code inside the <edited> element has the default namespace,
>>therefore it isn't matched.
>>
>>-- Andreas
> 
> 
> I've just noticed it. Thank you.
> The namespace is removed by Epoz.
> I had implemented the above xsl without xhtml: ,but somebody inserted
> the xhtml: back.

I did ;-)

  I wonder that saving worked with that xslt.
> 
> Michi: is it ok to use default namespace in the above xslt file?

without namespaces it didn't work in my case (I am using Xalan2.5.0).
What Xalan version are you using?

Michi




> We can try to trigger Epoz not to remove the namespace stuff. (?)
> 
> 


-- 
Michael Wechner
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com              http://cocoon.apache.org/lenya/
michael.wechner@wyona.com                        michi@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: [Epoz-development] Re: Problem with epozsave-xhtml.xsl

Posted by Guido Wesdorp <gu...@infrae.com>.
I just checked in a system that allows plugging in filters to filter the 
content of Epoz before it is saved. I wrote a first example filter as 
well, that removes all unknown tags including content and can filter out 
certain tags leaving the content in tact. If this filter is used in your 
case, the result would be that all dc: namespaced elements including 
their content would be removed from the HTML. Would this be of any help?

Cheers,

Guido

Rolf Kulemann wrote:

>On Mon, 2003-12-15 at 15:49, Andreas Hartmann wrote:
>  
>
>>Rolf Kulemann wrote:
>>[...]
>>    
>>
>>><xsl:template match="edit-envelope">
>>>  <html>
>>>    <xsl:copy-of select="original/xhtml:html/lenya:meta"/>
>>>    <head>      
>>>      <xsl:apply-templates select="edited/xhtml:html/xhtml:head/*"/>
>>>    </head>
>>>    <xsl:copy-of select="edited/xhtml:html/xhtml:body"/>
>>>  </html>
>>></xsl:template>
>>>...
>>>
>>>In this constellation it does not work on my machine. So the header and
>>>body of the "edited" tag are not captured, but the "original" meta
>>>stuff. If I remove all xhtml: it works fine.
>>>      
>>>
>>The code inside the <original> element has the XHTML namespace,
>>therefore it is matched by the XPath expression.
>>The code inside the <edited> element has the default namespace,
>>therefore it isn't matched.
>>
>>-- Andreas
>>    
>>
>
>I've just noticed it. Thank you.
>The namespace is removed by Epoz.
>I had implemented the above xsl without xhtml: ,but somebody inserted
>the xhtml: back. I wonder that saving worked with that xslt.
>
>Michi: is it ok to use default namespace in the above xslt file?
>We can try to trigger Epoz not to remove the namespace stuff. (?)
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: Problem with epozsave-xhtml.xsl

Posted by Rolf Kulemann <ma...@rolf-kulemann.com>.
On Mon, 2003-12-15 at 15:49, Andreas Hartmann wrote:
> Rolf Kulemann wrote:
> [...]
> > 
> > <xsl:template match="edit-envelope">
> >   <html>
> >     <xsl:copy-of select="original/xhtml:html/lenya:meta"/>
> >     <head>      
> >       <xsl:apply-templates select="edited/xhtml:html/xhtml:head/*"/>
> >     </head>
> >     <xsl:copy-of select="edited/xhtml:html/xhtml:body"/>
> >   </html>
> > </xsl:template>
> > ...
> > 
> > In this constellation it does not work on my machine. So the header and
> > body of the "edited" tag are not captured, but the "original" meta
> > stuff. If I remove all xhtml: it works fine.
> 
> The code inside the <original> element has the XHTML namespace,
> therefore it is matched by the XPath expression.
> The code inside the <edited> element has the default namespace,
> therefore it isn't matched.
> 
> -- Andreas

I've just noticed it. Thank you.
The namespace is removed by Epoz.
I had implemented the above xsl without xhtml: ,but somebody inserted
the xhtml: back. I wonder that saving worked with that xslt.

Michi: is it ok to use default namespace in the above xslt file?
We can try to trigger Epoz not to remove the namespace stuff. (?)


-- 
Rolf Kulemann

Patageometry, n.:
	The study of those mathematical properties that are invariant
under brain transplants.


PGP/GPG public key:
	 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6B4EA7EA


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: Problem with epozsave-xhtml.xsl

Posted by Andreas Hartmann <an...@apache.org>.
Rolf Kulemann wrote:
[...]
> 
> <xsl:template match="edit-envelope">
>   <html>
>     <xsl:copy-of select="original/xhtml:html/lenya:meta"/>
>     <head>      
>       <xsl:apply-templates select="edited/xhtml:html/xhtml:head/*"/>
>     </head>
>     <xsl:copy-of select="edited/xhtml:html/xhtml:body"/>
>   </html>
> </xsl:template>
> ...
> 
> In this constellation it does not work on my machine. So the header and
> body of the "edited" tag are not captured, but the "original" meta
> stuff. If I remove all xhtml: it works fine.

The code inside the <original> element has the XHTML namespace,
therefore it is matched by the XPath expression.
The code inside the <edited> element has the default namespace,
therefore it isn't matched.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org