create a clean-xhtml.xsl in your pub:
{yourpub}/lenya/modules/xhtml/xslt/clean-xhtml.xsl
[xsl begin stuff]
<!-- import templates clean-xhtml.xsl stylesheet -->
<xsl:import
href="template-fallback://{yourpub}//lenya/modules/xhtml/xslt/clean-xhtml.xsl"
/>
<!-- remove invalid <br /> elements -->
<xsl:template match="xhtml:body/xhtml:br" />
<!-- remove that nasty @align that shows up in the table -->
<xsl:template match="xhtml:[EMAIL PROTECTED]" >
<xsl:copy>
<xsl:apply-templates select="@*[name()!='align'][name()!='style']" >
<xsl:attribute name="style">align:<xsl:value-of
select="@align"/>;<xsl:value-of select="@style" /></xsl:attribute>
</xsl:copy>
</xsl:template>
[xsl end]
I didn't try the above, so not sure it works, but it would go something
like that. I know that it is not ideal to fix the editors code on save,
but the error below is a big usability no-no.
I have been thinking about turning off bxe validation for my pubs, and
just fixing problems as they are saved. The user might get some
unexpected content changes, but that is easier to explain (content must
adhere to our standards) than cryptic error messages.
You might also want to look at the fck module, it has the option of
using tidy (given a properties file) and the above clean-{type} method.
Users can go to town screwing up the source if they wish, and all is
forgiven on the server side.
--Doug
Richard Frovarp wrote:
Well, first it does tend to dump <br/>'s in, which fail validation:
element "br" from namespace "http://www.w3.org/1999/xhtml" not allowed
in this context
The table problem:
attribute "align" not allowed at this point; ignored
org.apache.cocoon.ProcessingException: Error calling continuation at
file:/home/rfrovarp/lenya-1.4.x/build/lenya/webapp/lenya/usecases/usecases.js:269
at <map:call> -
file:/home/rfrovarp/lenya-1.4.x/build/lenya/webapp/lenya/usecases/usecase.xmap:91:39
at <map:mount> -
file:/home/rfrovarp/lenya-1.4.x/build/lenya/webapp/lenya/usecase.xmap:56:128
at <map:mount> -
file:/home/rfrovarp/lenya-1.4.x/build/lenya/webapp/global-sitemap.xmap:313:105
at <map:mount> -
file:/home/rfrovarp/lenya-1.4.x/build/lenya/webapp/sitemap.xmap:632:106
The part from the stack trace is:
Caused by: org.apache.lenya.cms.usecase.UsecaseException:
org.xml.sax.SAXParseException: attribute "align" not allowed at this
point; ignored
at
org.apache.lenya.cms.usecase.AbstractUsecase.execute(AbstractUsecase.java:269)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Since it is using reflection, I'm not really sure which code it goes into.
Richard
Doug Chestnut wrote:
Whats the error?
BXE is using relaxNG, should be the same as when it is saved (and
validated again), although bxe uses a different validator than lenya
server side.
You might want to look at the clean-xhtml.xsl (or xhtml-clean.xsl)
stylesheet to clean up bxe boo-boos.
--Doug
Richard Frovarp wrote:
If you create a new page, delete existing content, then insert a
table and hit save, an error is thrown that seems to indicate that
the resulting page is not validated against whatever it uses to
validate (DTD, Schema, RelaxNG, haven't looked). Anyone know how to
get FCKEditor completely working?
Thanks,
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]