Dojo with / xml + xhtml content-type application

How can I get Dojo Dijits (1.5.0, currently) to work with XHTML as application / xml + xhtml? It works if sent as text / html, but / xml + xhtml application is required.

This seems to be related to dijit.form.DatePicker and several others.

This is not a matter of checking the W3C, it just doesn't work at all .

Error: mismatched tag. Expected: </br>. Source File: Line: 5, Column: 54 Source Code: ><div class="dijitReset dijitValidationIcon"><br></div 

JavaScript execution stops due to this error.

Obviously, I can recompile Dojo and fix it all separately, but it does a lot of work and does not fix everything.

Again, it works with the text / html, but the application / xml + xhtml is required.

+6
javascript mime-types xhtml dojo
source share
3 answers

I asked about server side in case you submitted your own assembly. In any case, I know that you do not want to make separate corrections and rebuilds, but I think that there is a solution in which you can β€œplan” but not redo it. Since the assembly embeds the string in the constructor of the function, you can modify it using the advanced functionality. In this case for ValidationTextBox you can do

 dijit.form.ValidationTextBox.extend({ templateString: "<div>apple sauce</div>" }); 

This will result in an entire future instance of dijit.form.ValidationTextBox to use the new template string. Although this may not be ideal, it may be the only way to fix this without rebuilding everything. Maybe something in shape

 dojo.require("dijit.form.ValidationTextBox"); dojo.require("my.ValidationTextBoxFix"); 

Good luck.

+1
source share

This has been fixed with the upcoming (as this week) release of Dojo Toolkit 1.5, but if you find the appropriate matching Dijit template, you can just change it to
without any side effects.

Hope this helps.

+4
source share

in xhtml you should have

 <br/> 

or

 <br></br> 

but I'm curious: who needs xhtml and why?

-one
source share

All Articles