Why is xml:space set to 'preserve' on all elements of XHTML?
I don't want to see extra space in my output.



Why is xml:space set to 'preserve' on all elements of XHTML? I don't want to see ext..

Answer / guest

The attribute xml:space is about input: that is to say, it
controls if the spaces will be present in the DOM (i.e. in
the internal version of the document inside the browser); it
says nothing about what will appear on your screen. Output
whitespace is controlled by the CSS property 'whitespace'.
Set it to 'pre' and the spaces in the DOM will be preserved
on output; set it to 'normal' and the whitespace will be
collapsed (CSS3 will have more properties to enable greater
control).

This is the reason that all elements are set to
xml:space="preserve" in XHTML2, otherwise the CSS
'whitespace' property would have no effect, and you would
have no control over visible whitespace. The default
stylesheet will set 'whitespace' to 'normal' for all
elements except <pre>, but you will be free to change them.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More HTML DHTML Interview Questions

Explain html5 graphics.

0 Answers  


What is nav code?

0 Answers  


What is the use of dom in html?

0 Answers  


What is the current version of html?

0 Answers  


Is html case sensitive?

0 Answers  






I have a project to design a new web page using notepad. please send me a web page designed using notpad that will help me on my project.Also send me toppic or idea of what kind of web page or purpose that my web page should have.use my e-mail adrees to send me ,that is, beteg13@yahoo.com .I WILL BE PLEASED IF YOU SEND ME WHAT EVER YOU HAVE THAT WILL HELP ME!

2 Answers  


What is manifest file in html5?

0 Answers  


Why doesn't <table width="100%"> use the full browser width?

0 Answers  


What is tsd stand for?

0 Answers  


How do I make a picture into a link?

0 Answers  


What is canvas made of?

0 Answers  


What is the difference between select and datalist in html?

0 Answers  


Categories