xhtml

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

允我心安 提交于 2019-12-04 04:22:11
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.parse(s); But I still get an exception on the last line ... java.net.SocketException: Unexpected end of

Fade text too long inside HTML element

老子叫甜甜 提交于 2019-12-04 04:21:21
So my questions is similar to this: crop text too long inside div What I don't want to do is have a hard end to the text (chopping off whatever text overflows). The desired output would not include an ellipses (...) but would "fade" away. So if I had something like: <div class="text">This is the really long area of text that I want to chop</div> then at wherever I decide, say midway in wa|nt... the n would be half faded, and the t would be almost completely faded. Of course the positioning is random and could fall acroos 3 or 4 letters... Here are acceptable solutions in order of preference.

Please explain in detail this part of YUI3 CSS Reset

旧时模样 提交于 2019-12-04 04:05:43
问题 What is the usefulness of these 2 things in CSS reset? What is the problem in resizing of input elements in IE and in which version? and if legend color doesn't inherit in IE then how it can be solved adding color:#000; /*to enable resizing for IE*/ input, textarea, select { *font-size:100%; } /*because legend doesn't inherit in IE */ legend { color:#000; } 回答1: The first rule actually doesn't apply on IE only, but on all webbrowsers. Normally you would like to define a global font in the

can I apply IDs more than once in CSS? [closed]

人盡茶涼 提交于 2019-12-04 03:57:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . This is a beginner's question, but I need to clarify it. Yes according to most of the tutorials it cannot be applied more than once. ID's are unique Each element can have only one ID Each page can have only one element with that ID Reference http://css-tricks.com/the-difference-between-id-and-class/ But I wrote

What are cons to use Cufon? Is sIFR still good option? @font-face doesn't make the letters smooth like they look with cufon or sIFR

荒凉一梦 提交于 2019-12-04 03:34:08
问题 What are cons to use Cufon? in term of Web Standards, Accessibility and Performance. I think if we need smooth text than sIFR is still best with screen reader compatibility. With @font-face font doesn't look smooth like Cufon and Sifr. but Cufon use canvas tag for each letter which it maked harder to read for screenreaders. To make font smooth is sIFR still best and accessibility compatibility solution? Is it possible to get Anti-aliasing like Image, sIFR and cufon with using @font-face? 回答1:

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

时间秒杀一切 提交于 2019-12-04 03:18:03
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="box"> // box content </div> <div class="box"> // box content </div> <div class="box"> // box content <

Is it possible to use CDATA inside <pre> tag

旧街凉风 提交于 2019-12-04 03:17:40
问题 I want to display an exception trace in the HTML page. One way to do this is to escape HTML special characters in the exception trace and dump it inside the <pre> tag. Although it works, it's terribly inefficient. I thought that one approach would be to wrap the trace with CDATA. I've tried it, but nothing get's displayed. My question, can this be done? Here is my feeble attempt. <pre><![CDATA[blah, blah, blah with <> and blah blah blah with & and more blah, blah]]></pre> 回答1: It would only

Loading XHTML fragments over AJAX with jQuery

主宰稳场 提交于 2019-12-04 03:06:01
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 Document object, and when I try to insert it into the DOM, I receive the following error: uncaught

What does the xmlns attribute do? [duplicate]

耗尽温柔 提交于 2019-12-04 02:54:49
This question already has an answer here: What does “xmlns” in XML mean? 5 answers Validation requires that I set it but why? I like to think the code in my xhtml document is doing something. Kyle 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 the W3 website): XML data to define an html table: <table> <tr> <td>Apples</td> <td>Bananas</td> </tr> </table> XML data to

jQuery Selecting the first child with a specific attribute

别说谁变了你拦得住时间么 提交于 2019-12-04 02:50:36
问题 I have a form in HTML with multiple inputs of type submit: <form id = "myForm1" action="doSomethingImportant/10" class="postLink" method="post"> <input type="hidden" id="antiCSRF" name="antiCSRF" value="12345"></input> <input type="submit" value="clickThisLink"></input> <input type="submit" value="Don'tclickThisLink"></input> </form> What I want to do is select only the first input with type submit while ignoring the others, the snippet of code I currently have is as follows, note it is