xhtml

id and name attributes of HTML 4.01 and XHTML 1

对着背影说爱祢 提交于 2019-12-08 10:08:58
问题 In HTML, the name attribute may be used for the elements a, applet, form, frame, iframe, img, and map . The name attribute and the id attribute may be used in HTML to identify document fragments. XHTML documents must use id instead of name for identifying document fragments in the aforementioned elements. In fact, the name attribute for these elements has been deprecated in the XHTML 1.0 specification. Then how do they replace the requirement of name attribute in XHTML? Because, for some tags

HTML classes and IDs with with $ or non alpha numeric characters

会有一股神秘感。 提交于 2019-12-08 09:48:18
问题 I'm looking at some site code on an XHTML doctype and from what I'm seeing the framework is ASP.net. The IDs in the HTML has a "$" in there. For example: <img id="$ct100templateContent$SectionPanel1$ctl01$ctl02ctl00_templateContent_SectionPanel1_ctl01_ct999img" src="this.jpg"/> From a W3C semantic point of view the "$" is not valid in an ID or Class. IDs and classes can only contain alpha numeric characters in an XHTML doctype. Is the the "$" a ASP.net naming convention referencing a web

DOMDocument & XPath - HTML Tag of each Node

时间秒杀一切 提交于 2019-12-08 08:41:33
Given the following PHP code using DOMDocument : $inputs = $xpath->query('//input | //select | //textarea', $form); if ($inputs->length > 0) { for ($j = 0; $j < $inputs->length; $j++) { $input = $inputs->item($j); $input->getAttribute('name'); // Returns the Attribute $input->getTag(); // How can I get the input, select or textarea tag? } } How can I know the tag name of each matched node? $inputs = $xpath->query('//input | //select | //textarea', $form); // no need for "if ($inputs->length > 0) - the for loop won't run if it is 0 for ($j = 0; $j < $inputs->length; $j++) { $input = $inputs-

positioning a div inside another div?

被刻印的时光 ゝ 提交于 2019-12-08 08:32:43
问题 In a big div I have search box which basically is a div having text box glass image and button. Requirement is to positioned this search wizard vertically in middle and on right side in div. This box is coming on top left inside div. I have tried different things but not getting how to set it. Please guide me. Thanks <div class="Right"> <div class="header-search" style="position: relative; top: auto; bottom: auto; right: 0 left:100%; margin: auto 0 auto auto;"> <input type="text" class=

How to use RDFa “vocab” within XHTML

牧云@^-^@ 提交于 2019-12-08 07:09:04
问题 I'm trying to get this (simple) webpage done for my assignment and it needs to pass through http://validator.w3.org/ It also needs to use RDFa. However no matter what I do, the RDFa vocab never gets passed by the validator. Here's what I got: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> <body vocab="http://xmlns.com/foaf/0.1/"> What am I doing wrong? 回答1: The vocab attribute is defined in RDFa 1.1, but with your current DOCTYPE, you

Expanding paragraph (html) for news section

旧巷老猫 提交于 2019-12-08 06:45:41
问题 I'm not sure how to go about this. I have a news section on a website I maintain and I'm trying to get it to display about 10 news items. Then I want to give users the option to click "more" for the rest, and the "less" for back to default. The document is xhtml and css and I'm trying to use as little javascript as possible. Any ideas? 回答1: If you want all the news article to actually be on the page, just invisible, versus having to request more from the server when the user clicks more, and

UTF8 encoded XHTML content in JSP

女生的网名这么多〃 提交于 2019-12-08 06:38:07
问题 I am trying to display XHTML content in a JSP page. The encoding is UTF8. The jsp page calls a method in a java class and the method returns the xhtml content. Basically this is what I have in my jsp page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <% response.setContentType("application/xhtml+xml"); %> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content

How to extract source from Google search result “20-pack” entry?

自古美人都是妖i 提交于 2019-12-08 06:19:31
问题 The search results page for a local Google search typically looks like this, containing 20 results. In order to get the full contact details for any given result on the left-hand-side, the result needs to be clicked, bringing up (after a lengthy wait) an overlay (not sure of the technical term) over the Google Maps pane (on Firefox, does something different on other web browsers): I am extracting the business name. address, phone and website with Python and WebDriver thus: address = driver

Displaying xhtml content in a jsp page

Deadly 提交于 2019-12-08 06:11:42
问题 I have a JSP page that displays XHTML content. I have included the following lines at the top of my JSP page: <?xml version="1.0" encoding="UTF-8"?> <% response.setContentType("application/xhtml+xml"); %> <% request.setCharacterEncoding("UTF-8"); %> If I change the above line to: <?xml version="1.0" encoding="UTF-8"?> <% response.setContentType("application/xhtml+xml;charset=UTF-8"); %> <% request.setCharacterEncoding("UTF-8"); %> The page stops rendering and throws XML parsing error such as

How DOM works/is loaded? (in HTML)

给你一囗甜甜゛ 提交于 2019-12-08 06:06:59
问题 How DOM is loaded in a html page? First is load the all html tag ( ) and inside of this element is created an other element and so on or first is create followed by ... and finally, the closing tags are added? Thank you! 回答1: More or less. The HTML 5.2 specification has a parsing algorithm. 回答2: Generally the whole DOM is loaded into the memory, the order in which the elements are created is internal to the parser implementation and is not exposed. If you need to parse as document loads you