Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What is xhtml modularization?

0 Answers  


Which browsers have a support to html 5?

0 Answers  


What is meta title tag?

0 Answers  


How do I create frames? What is a frameset?

0 Answers  


What is <form> tag and why it is used?

0 Answers  


What is inline tag?

0 Answers  


What is an html file?

0 Answers  


What are the frequently useful api in html5?

0 Answers  


How do I make sure my framed documents are displayed inside their frameset?

0 Answers  


What is doctype & why it is important?

0 Answers  


Name 4 new elements in html5 that were not available in previous html versions.

0 Answers  


Expand HTML

0 Answers   Hexaware,


Categories