Bug 43746

Summary: BXE removes target attribute of <a> elements
Product: Lenya Reporter: Andreas Hartmann <andreas>
Component: MiscellaneousAssignee: Lenya Developers <dev>
Status: REOPENED ---    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: 2.0.1   
Hardware: Other   
OS: other   

Description Andreas Hartmann 2007-10-31 05:03:31 UTC
 
Comment 1 Andreas Hartmann 2007-10-31 05:03:57 UTC
The save request still contains the attribute, so it is removed on the server.
Comment 2 Andreas Hartmann 2007-10-31 05:06:22 UTC
It is removed in modules/xhtml/xslt/clean-xhtml.xsl:

  <!-- Unsupported by the schema -->
  <xsl:template match="@shape|@target|xhtml:u">
    <xsl:apply-templates />
  </xsl:template>
  
Why does the XSLT make assumptions about the schema?
Comment 3 Andreas Hartmann 2007-10-31 05:07:55 UTC
So the problem lies in the XHTML module.
Comment 4 Richard Frovarp 2007-10-31 06:51:29 UTC
target isn't a valid attribute of, well anything in XHTML 1.0 strict. And u
isn't an element in XHTML 1.0 strict either. @shape is valid for area and a, so
that one could be removed.(In reply to comment #2)
> It is removed in modules/xhtml/xslt/clean-xhtml.xsl:
> 
>   <!-- Unsupported by the schema -->
>   <xsl:template match="@shape|@target|xhtml:u">
>     <xsl:apply-templates />
>   </xsl:template>
>   
> Why does the XSLT make assumptions about the schema?

The assumption is to support XHTML 1.0 Strict, which would make sense to me.
target isn't a valid attribute of, well anything in XHTML 1.0 strict. And u
isn't an element in XHTML 1.0 strict either. @shape is valid for area and a, so
that one could be removed.
Comment 5 Andreas Hartmann 2007-10-31 06:55:11 UTC
The Uniklinik Freiburg needs the attribute.

Maybe we could add an option which XHTML schema to use
(strict/transitional/basic) and choose the schema and clean-xhtml.xsl accordingly?
Comment 6 Richard Frovarp 2007-10-31 07:05:05 UTC
(In reply to comment #5)
> The Uniklinik Freiburg needs the attribute.
> 
> Maybe we could add an option which XHTML schema to use
> (strict/transitional/basic) and choose the schema and clean-xhtml.xsl accordingly?

Well, this is a larger issue. They should go through and edit the file, due to
the fact they have a custom non-standard need and should be able to put their
version of the file in their publication. I need center align and have had to
hack my rng files to include it. 

Anyone who uses FCKeditor or TinyMCE has to hack the
src/modules/xhtml/resources/schemas/xhtml.rng file to include a larger set of
XHTML. Doing this break BXE unfortunately. 

Adding an option to easily choose the level of support makes sense. However, the
default should be a subset of XHTML Strict.