xhtml

Groovy XMLSlurper issue

浪子不回头ぞ 提交于 2019-12-11 07:00:06
问题 I want to parse with XmlSlurper a HTML document which I read using HTTPBuilder. Initialy I tried to do it this way: def response = http.get(path: "index.php", contentType: TEXT) def slurper = new XmlSlurper() def xml = slurper.parse(response) But it produces an exception: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd I found a workaround to provide cached DTD files. I found a simple implementation of class which

PHP to compare and return a variable in a querystring

心已入冬 提交于 2019-12-11 06:59:38
问题 I need a bit of simple PHP code that can return a specified variable if any one of three variables is contained within a query string. Probably easier to explain like this: if {querystring} contains {var1} or {var2} or {var3} return {var1} This is expands on the following question: Creating a canonical with PHP I need to add said code to one of the variables specified in function params , in the linked question. 回答1: function evaluateThis($var1,$var2,$var3) { if((strpos($string,$var1) !==

Output Javascript document.write in XSL

房东的猫 提交于 2019-12-11 06:52:43
问题 I'm having major trouble to output a document.write() javascript through my XSL page. (It's part of a 3rd party external tracking code snippet) My desired output is: document.write('<sc'+'ript src="'+'http'+(document.location.protocol=='https:'?'s':'')+'://'+ia_link+'"></sc'+'ript>'); An this is my complete Code: <script language="JavaScript" type="text/javascript"> var url="someurl.js"; var blablabla="some-dynamic-values"; var ia_link=url+'?parameter='+blablabla; </script> <script> <xsl:text

Replacing more than one attributes in XSLT (with identity template)

独自空忆成欢 提交于 2019-12-11 06:27:20
问题 Hi I have to replace more than one attributes of a given tag using XSLT while copying the entire file with identity template. With my given XSLT I'm able to replace one attribute (value of class) but not the other one. Input file: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 11

Xpath deepest node whose string content is longer than a given length

别来无恙 提交于 2019-12-11 06:27:00
问题 How does one use XPath to find the deepest node that matches a string content length constraint. Given a chunk of XHTML (or XML) that looks like this: <html> <body> <div id="page"> <div id="desc"> This wool sweater has the following features: <ul> <li>4 buttons</li> <li>Merino Wool</li> </ul> </div> </div> ... </body> </html> An an XPath expression like //*[string-length() > 50] Would match the <html>, <body>, <div id="page"> and <div id="desc"> . How can one make XPath pick the deepest

How to start background repeat-y after 46px space?

帅比萌擦擦* 提交于 2019-12-11 06:25:03
问题 #data-wrapper { background:url("../images/repeat-bg.png") repeat-y 0 46px transparent;} I want to start repeat-bg.png as a repeat-y but after 46px area from top of #data-wrapper . Is it possible to do like this? 回答1: You need to apply the background image to a containing div with 46px margin. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <style type="text/css"> #container { background:url("../images/repeat-bg.png") repeat-y; margin-top:46px; height:600px;} /* height:600px is

XSLT Navigation Menu

◇◆丶佛笑我妖孽 提交于 2019-12-11 06:06:49
问题 I have a question on XSL-Transformation (XSLT-1). I am trying it since days, but I didn't get it to work. I want to build a standard website tree navigation with XML and XSLT-1. It should only show the items on the path to the current item. if the current item has child-items, the next node should be opened. My XML source is like this: <cat> <item id="0" name="1"> <item id="1" name="1.1"></item> <item id="2" name="1.2"></item> <item id="3" name="1.3"></item> <item id="4" name="1.4"> <item id=

Send Email from SQL Server database with multiple tables in email body

倾然丶 夕夏残阳落幕 提交于 2019-12-11 06:00:11
问题 I am challenged by the following task. Here is my question in detail: I need to send email from SQL Server with HTML table format that the email body will have several tables. Query will be from database like SELECT Field1, Field2, Field3 FROM Table WHERE DateField >= Somedate Field3 will be the factor to separate the tables, hence, the result will be grouped by Field3 values and put on separate tables The email content will be more or less like the following (screenshot is attached) Section:

Is possible to capture KeyDown event when current document is in design mode?

元气小坏坏 提交于 2019-12-11 05:51:16
问题 As you know, most of rich text editor use iframe to create WYSIWYG editor. In iframe contain document that is in design mode. I want to capture key down event when user press '@' character in rich text editor for displaying autocomplete for it. By the way, i cannot see any fired event inside design mode. How can I solve this question? 回答1: It's perfectly possible to capture all key events in documents with designMode turned on, though you have to use addEventListener on document in Firefox

how to execute (or not) an ajax call based on a condition

爱⌒轻易说出口 提交于 2019-12-11 05:44:50
问题 I need to execute a call using Ajax, but first, I also have to make a validation on my backing bean's method. Based on a boolean returned by this method, the ajax call will be executed (returned true) or not (returned false, for example). To be more specific and to give a touchable example, I am trying to open a dialog after I click on a button. This is my .xhtml code: <h:form id="tableVendasNaoPagas"> <p:dataTable value="#{relatorioVendaMB.vendasNaoPagas}" var="venda" rowKey="#{venda.codigo}