xhtml

Browser Rendering Difference Between strict/transitional DOCTYPEs

本秂侑毒 提交于 2019-12-21 17:19:44
问题 I came across an 'issue' some time ago that I never did get to the bottom of. Hopefully somebody can shine a light on it. What causes certain browsers (Chrome, Opera and Safari) to render a page differently when I change the DOCTYPE from strict to transitional. I know the general cause of this is quirks mode being triggered, but both the XHTML and CSS for both files validate according to the w3c validator. I can only assume that these browsers use different internal style sheets for the two

How do I turn off validation when parsing well-formed XML using DocumentBuilder.parse?

我的未来我决定 提交于 2019-12-21 11:30:22
问题 I'm using Java 6. I want to parse XHTML that I know is well-formed. As such, I don't want to do any validation against DTD's or other schemas referenced in the doc. However, I'm having trouble figuring out how to turn that validation off. I have DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); final DocumentBuilder b = factory.newDocumentBuilder(); final InputSource s = new InputSource(new StringReader(str)); org.w3c.dom.Document result = b

IE8 - Container with margin-top: 10px has no margin

青春壹個敷衍的年華 提交于 2019-12-21 11:24:01
问题 EDIT: This happens only in IE8, it works fine in IE7, Firefox, Opera etc First of all, here is a picture I have made in photoshop to demonstrate my problem: http://richardknop.com/pict.jpg Now you should have idea about my issue. Here is a simplified version of markup I'm using (I left out most irrelevant content): <div class="left"> <div class="box"> // box content </div> <div class="box"> // box content </div> <div class="box"> // box content </div> </div> <div class="right"> <div class=

Loading XHTML fragments over AJAX with jQuery

放肆的年华 提交于 2019-12-21 09:07:24
问题 I'm trying to load fragments of XHTML markup using jQuery's $.fn.load function, but it raises an error trying to add the new markup into the DOM. I've narrowed this down to the XML declaration ( <?xml...?> ) -- the view works if I return static text without the declaration. I don't understand why this would cause failure, or if the blame lies in jQuery, Firefox, or my code. How should I insert XHTML fragments into the DOM using jQuery? Using $.get does not work -- the callback receives a

What does the xmlns attribute do? [duplicate]

北城余情 提交于 2019-12-21 07:28:14
问题 This question already has answers here : What does “xmlns” in XML mean? (5 answers) Closed 3 years ago . Validation requires that I set it but why? I like to think the code in my xhtml document is doing something. 回答1: From the W3Schools: the xmlns attribute specifies the xml namespace for a document. This basically helps to avoid namespace conflicts between different xml documents, if for instance a developer mixes xml documents from different xml applications. An example of this (also from

Official XSLT validator?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 07:25:27
问题 Is there any official XSLT validator, like http://validator.w3.org/ for HTML & XHTML? I know http://validator.w3.org/ can also be used to validate XML and XSL documents. But they are validated as XML structures. In valid XHTML, for example, <span><div>...</div></span> is invalid, as block elements should not appear inside in-line elements. So, is there a convenient way, to directly validate the XSL document? (i guess we may combine XML and XSL, output the XHTML, then validate it. But this is

Nicely formatted source code

天涯浪子 提交于 2019-12-21 06:05:16
问题 The source code is already formatted using newline characters and whitespace. Goals: keep source formatting as long as lines fit in the screen horizontally (e.g. pre) show line numbers on the left side aligned with the lines (e.g. a table with line numbers in a separate column) break lines into multiple lines when they do not fit in the screen (e.g. doable with white-space: pre-wrap) never merge whitespace or newline characters (e.g. pre does that) for lines that break either show the line

Validation of XML Sitemap urlset with xhtml:link inside url element

泪湿孤枕 提交于 2019-12-21 05:28:13
问题 I am trying to create a sitemap such as the below and I get this error: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xhtml:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <url> <loc>http://www.something.com/something</loc> <xhtml:link rel="alternate" hreflang="en-us" href="http://www.something.com/something" /> </url> </urlset>

HTML attribute accesskey not working as it should

谁说胖子不能爱 提交于 2019-12-21 05:02:06
问题 So, I'm testing all different HTML tags and attributes, freshing things up a bit, and for some reason, accesskey does not appear to be working. The accesskey attribute is used to assign a key to an element. Depending on your OS, pressing Alt+that key (Windows) or Cmd+that key (Mac) will give focus to that element. Here's a little something: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en

Why do internal TABLE sections have to go THEAD TFOOT TBODY to validate?

ぃ、小莉子 提交于 2019-12-21 03:15:09
问题 I often use THEAD, TBODY, and TFOOT elements to divide my data tables into sections that can be addressed separately with CSS. I also understand that there is always an implicit TBODY tag. What puzzles me is the order that these have to go in to validate. THIS table will validate: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta http-equiv="Content-Type"