You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by mdossing <ms...@cs.bham.ac.uk> on 2008/08/06 19:51:33 UTC

MathML in wicket

Hi,

I am undergoing a project that involves outputting MathML to wicket pages.

I use a custom label that outputs my string directly in to a body tag so
that it isn't escaped. The problem comes when I change the page to be of the
type xhtml with the following code:

    public final String getMarkupType() {
        return "xhtml";
    }
    
    protected final void configureResponse() {
        super.configureResponse();
        getResponse().setContentType("text/html");
    }

With some example mathml of:
<math xmlns="http://www.w3.org/1998/Math/MathML"
      xmlns:mml="http://www.w3.org/1998/Math/MathML">
   <mrow>
      <mrow>
         <mrow/>
         <mo>&#x2061;</mo>
         <mfenced separators=",">
            <mrow>
               <mrow/>
               <mo>&#x2061;</mo>
               <mfenced separators=",">
                  <mi>X</mi>
               </mfenced>
            </mrow>
         </mfenced>
      </mrow>
      <mo>=</mo>
      <mo>&#x2205;</mo>
   </mrow>
</math>

Ran in a normal xhtml page i get something along the lines of ((X)) = ∅ but
instead wicket throws out    ∅   =  0  and longer mathml just throws out
more random characters.

Any help would be appreciated,
Martin
-- 
View this message in context: http://www.nabble.com/MathML-in-wicket-tp18856345p18856345.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: MathML in wicket

Posted by mdossing <ms...@cs.bham.ac.uk>.
Update -

After some reading i realised that wicket was overwriting my utf-8 header. I
managed to get it to work by changing
getResponse().setContentType("text/html"); to
getResponse().setContentType("utf-8"); There are now a number of display
errors, but certainly nothing unfixable.

Regards,
Martin



Brill Pappin wrote:
> 
> Check the char encoding... it might actually be working properly but  
> somewhere along the line the wrong encoding is being used.
> 
> - Brill
> 
> On 6-Aug-08, at 1:51 PM, mdossing wrote:
> 
>>
>> Hi,
>>
>> I am undergoing a project that involves outputting MathML to wicket  
>> pages.
>>
>> I use a custom label that outputs my string directly in to a body  
>> tag so
>> that it isn't escaped. The problem comes when I change the page to  
>> be of the
>> type xhtml with the following code:
>>
>>    public final String getMarkupType() {
>>        return "xhtml";
>>    }
>>
>>    protected final void configureResponse() {
>>        super.configureResponse();
>>        getResponse().setContentType("text/html");
>>    }
>>
>> With some example mathml of:
>> <math xmlns="http://www.w3.org/1998/Math/MathML"
>>      xmlns:mml="http://www.w3.org/1998/Math/MathML">
>>   <mrow>
>>      <mrow>
>>         <mrow/>
>>         <mo>&#x2061;</mo>
>>         <mfenced separators=",">
>>            <mrow>
>>               <mrow/>
>>               <mo>&#x2061;</mo>
>>               <mfenced separators=",">
>>                  <mi>X</mi>
>>               </mfenced>
>>            </mrow>
>>         </mfenced>
>>      </mrow>
>>      <mo>=</mo>
>>      <mo>&#x2205;</mo>
>>   </mrow>
>> </math>
>>
>> Ran in a normal xhtml page i get something along the lines of ((X))  
>> = ∅ but
>> instead wicket throws out    ∅   =  0  and longer mathml just  
>> throws out
>> more random characters.
>>
>> Any help would be appreciated,
>> Martin
>> -- 
>> View this message in context:
>> http://www.nabble.com/MathML-in-wicket-tp18856345p18856345.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/MathML-in-wicket-tp18856345p18870915.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: MathML in wicket

Posted by Brill Pappin <br...@pappin.ca>.
Check the char encoding... it might actually be working properly but  
somewhere along the line the wrong encoding is being used.

- Brill

On 6-Aug-08, at 1:51 PM, mdossing wrote:

>
> Hi,
>
> I am undergoing a project that involves outputting MathML to wicket  
> pages.
>
> I use a custom label that outputs my string directly in to a body  
> tag so
> that it isn't escaped. The problem comes when I change the page to  
> be of the
> type xhtml with the following code:
>
>    public final String getMarkupType() {
>        return "xhtml";
>    }
>
>    protected final void configureResponse() {
>        super.configureResponse();
>        getResponse().setContentType("text/html");
>    }
>
> With some example mathml of:
> <math xmlns="http://www.w3.org/1998/Math/MathML"
>      xmlns:mml="http://www.w3.org/1998/Math/MathML">
>   <mrow>
>      <mrow>
>         <mrow/>
>         <mo>&#x2061;</mo>
>         <mfenced separators=",">
>            <mrow>
>               <mrow/>
>               <mo>&#x2061;</mo>
>               <mfenced separators=",">
>                  <mi>X</mi>
>               </mfenced>
>            </mrow>
>         </mfenced>
>      </mrow>
>      <mo>=</mo>
>      <mo>&#x2205;</mo>
>   </mrow>
> </math>
>
> Ran in a normal xhtml page i get something along the lines of ((X))  
> = ∅ but
> instead wicket throws out    ∅   =  0  and longer mathml just  
> throws out
> more random characters.
>
> Any help would be appreciated,
> Martin
> -- 
> View this message in context: http://www.nabble.com/MathML-in-wicket-tp18856345p18856345.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org