w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
XSLT two transformations in one file
I think instead of <!-- add the rest of attributes without change --> <xsl:copy-of select="node()"/> you simply want <!-- run the child elements through the identity transformation template for copying or my templates for transforming --> <xsl:apply-templates/> then you can use <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> and of course your <xsl:template match="NADR_KOD/NADR_KOD"> <NADR_KOD2> <xsl:apply-templates select="@*|node()"/> </NADR_KOD2> </xsl:template> If you want to transform further elements then you can add templates for them.

Categories : Xml

Is it possible to use Jackson for XSLT transformations
I don't think so - by the amount of complexity I think that you will need to write down an parser (I'm used to create some xslt to transform my stuff but I'm always trying to keep it simple and sane - even if you could it would end up way too complex, IMHO)

Categories : Xml

Converting XML to XSL With XSLT Transformations
<drugs xmlns="http://drugbank.ca" ....> This is your "problem" - because the XML file has a default namespace declaration, all the unprefixed element names in the file are in this namespace. Now in XPath (1.0) expressions, unprefixed names always select nodes that are not in a namespace, so <xsl:for-each select="drugs/drug"> selects nothing. You need to bind a prefix to the http://drugbank.ca namespace in your stylesheet, and use this prefix in the XPath expressions <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:db="http://drugbank.ca" exclude-result-prefixes="db"> <xsl:output method="html" encoding="UTF-8"/> <xsl:template match="/"> <!-- ... boilerplate o

Categories : Xml

What does "a processor independent API to XSLT transformations" mean?
Each XSLT library implements or interfaces a given XSLT processor. All libraries (should) support a given minimum API regardless of what XSLT processor it implements. This minimum API is what is referred to in the documentation.

Categories : PHP

apply two consecutive xslt transformations
I don't know which version of XSLT is supported in your environment, with XSLT 2.0 you can use <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:variable name="step1"> <xsl:apply-templates mode="step1"/> </xsl:variable> <xsl:template match="@*|node()[not(self::*)]" mode="step1"> <xsl:copy/> </xsl:template> <xsl:template match="*" mode="step1"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="node()|@*" mode="step1"/> </xsl:element> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="$step1//entry"/> </xsl

Categories : Xslt

Can I ignore namespaces with XSLT and then perform more transformations in the same stylesheet?
I believe "exclude-result-prefixes" is what you are looking for in the XSLT declaration. http://www.w3schools.com/xsl/el_stylesheet.asp

Categories : Xslt

pass a javascript variable within a html page into a html form (on the same page) for submission to perl cgi
Add a hidden field. Set the value in that field to the value of the variable in Javascript. <form action="cgi-bin/runalg.cgi" method="post" enctype="multipart/form-data"> [...] <input type="hidden" name="ID" value="default"> </form> And then on javascript: <script type="text/javascript"> document.forms[0].elements["ID"].value = getValue("ID"); </script> The index for the form may vary in your document.

Categories : Javascript

executing javascript after bringing xslt page by ajax
If a page loaded with Ajax contains javascript, then indeed the code will not get executed. If you have control over the javascript and you get the javascript in a single variable you could 'eval' this code and execute the javascript that way. But it is not very secure. You need to put the 'eval' after the ajax.get function. So in pseudo code: var data = ajax.get("my.xslt"); var d = JSON.decode(data); var xslt = d.xslt; var script = d.script; eval(script); div.innerHTML = xslt;

Categories : Javascript

animating css transformations with javascript
I saw Ilya's comment about matrices, which is probably a good thing to check out. Given I am struggled at matrix math, a string based solution is right up my alley. I threw this together in about half an hour but it seems to work well. I assume you'll just capture mouse move and update the translate value. I created the toObject method in case you wanted to do some more advanced animations. I think if you're going to go this route, you should reconsider not wanting to use frameworks. (function() { var setTransFunc, getTransFunc; // make sure cross browser... // I don't know if this is nescessary. Every browser I tried worked on the first options. (function () { var testElem = document.createElement('DIV'); if (testElem.style.transform !== undefined

Categories : Javascript

javascript library for 3d transformations
Here a plugin for css3 effects Effects and kindly read this as note: Note(othr brwsers)

Categories : CSS

Updating view bounds after canvas transformations (rotate, scale, transform)
I just made following code for my needs. import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.JLabel; public class RotatedLabel extends JLabel { //we need to remember original size private int originalWidth = 0; private int originalHeight = 0; //I do rotation around the center of label, so save it too private int originX = 0; private int originY = 0; public RotatedLabel(String text, int horizotalAlignment) { super(text, horizotalAlignment); } @Override public void setBounds(int x, int y, int width, int height) { //save new data originX = x + width / 2; originY = y + height / 2; originalWidth = width;

Categories : Java

in xslt 2.0, can I import a common xslt file into two files where one outputs xml and the other output html?
As Ken Holman says, the answer is yes, you can do exactly what you are suggesting. @Nalaka526 if your read the question then you will see that it only demands a "yes" or "no" answer. The only reason my answer is longer is that SO doesn't allow short answers.

Categories : Xslt

JavaScript library for matrix-like transformations on 2D text arrays?
Have a look at math.js. It can do matrix operations. Also check out Sylvester this I think might be easier to work with. It can even handle three dimensional space. Here is a small example from it var V1 = $V([3,4,5]); var V2 = $V([9,-3,0]); var d = V1.dot(V2); // d is 15 var c = V1.cross(V2); // c is the vector (15,45,-45) There is also webgl-mjs optimized for WebGL usage. Also look at this answer relating to rotation with your own function. Hope that helps :)

Categories : Javascript

Passing value input by user to another html page using javascript and redirect using javascript function
For this kind of stuff you have to use a server-side language (PHP, ASP, etc.) as you can pass variables thru files and so forth. Doing this with HTML/JS only is going to get you in trouble as you are basically giving the user, pass and id to anyone openly. Have a look here: PHP Codecademy.com

Categories : Javascript

Can't add view as html page (sails.js)
Why do you want to directly pass a file with .html extension , why not just '/fooDetails': { view: 'foo/details' } And then paste all your html in details.ejs ?

Categories : HTML

Printing a View within a page of html Drupal 6
Well, I got it to work by updating all modules and core to 6.28 (from 6.26) Don't know why that code would not have worked. I must have had some specific version of some module that conflicted with some other more updated module! Anyway, what worked just fine was: <?php $block = module_invoke('views', 'block', 'view', 'sc_file_view-block_4'); print $block['content']; ?>

Categories : Misc

Dojo - using
Thre are a couple of ways, one is to use performTransition from the view. Use the dijit registry to get the view and call its performtransition function. args 1. view transitioning to 2. direction of transition(left or right) 3. type of transition(slide, fade ....) dijit.registry.byId("ViewOne").performTransition("ViewTwo", 1, "slide");

Categories : HTML

Why would HTML show up in view:source but not be displayed or rendered on the page?
Any changes from the raw html you see in view source to the rendered DOM in the browser is caused by JavaScript. There must be some code on that page that is removing your table. Can you please provide some code examples of scripts that are on the page and that you are including?

Categories : HTML

How can I locate and view Javascript that's being used on a page?
Right click on page view source,Then search for hidetrail ur function using CTRL f it will be written inside javascript, Or the Javascript may be linked through external source then in that case you have to search in that externally added file.

Categories : Javascript

go to another page html with javascript
Since your button is a submit button, I think it is submitting the form after the JS is done and this could be the reason why you don't get redirected to Test.html (as form action attribute doesn't have any value.) Try the below code for the HTML form and check if this solves the issue. <form method="post" action="" name="form1" onsubmit="verif(document.form1.code);return false;">entre the pasword: <input type="password" name="code" placeholder="code" maxlength="6"> <p class="submit"> <input type="submit" name="commit" value="send"> </p> </form> The return false; in the onsubmit attribute prevents the form's default submit action. The verif(document.form1.code) will be executed whenever the form is submitted (that is the submit but

Categories : Javascript

where to load javascript in a view page Cakephp
here is very good concept and also i have applied in one of my application, it is working very well it compatible with CakePHP 2.1, and packaged it as a plugin. And also upgraded the CSS compression from CSSTidy to the more recent and better maintained CSS Min. The plugin is quick and easy to install. The installation instructions are somewhat long - but that's just to provide clarity. for detail view you can refer Detail link Cakephp.org also you can see the plugin document and how to use it in your appliation

Categories : Cakephp

Download a div in a HTML page as pdf using javascript
There is no such a mechanism in jQuery, but you can use plugins like http://www.webresourcesdepot.com/create-pdf-files-with-javascript-jspdf/ Also check this post Is it possible to generate PDF using jQuery?

Categories : Javascript

Localize HTML-Page with JavaScript
Define the variables before trying to store data: label = {}; label["login"] = {}; label["login"]["fr"]="Connection"; label["login"]["en"]="Login"; Or label = { login : { fr : "Connection", en : "Login" } };

Categories : Javascript

How do I load an HTML page in a
You can use the jQuery load function: <div id="topBar"> <a href ="#" id="load_home"> HOME </a> </div> <div id ="content"> </div> <script> $(document).ready( function() { $("#load_home").on("click", function() { $("#content").load("content.html"); }); }); </script> Sorry. Edited for the on click instead of on load.

Categories : Javascript

How to update HTML div from second/another page using javascript/Jquery?
the behaviour sounds like a chat behaviour. If all our clients/customers are running with modern browser you can do this with websockets. There is a .Net implementation for websockets available here (http://superwebsocket.codeplex.com/). The advantage of websockets are that they are realtime. So you simply press a button on your ActionPage.aspx and send a message to your server and on your Displaypage.aspx got updated instantly. You can take a look at this Stackoverflow question (server implementation): How to create a WebSocket server using SuperWebSocket And for the client you can use this tutorial: http://www.tutorialspoint.com/html5/html5_websocket.htm

Categories : Javascript

passing data from an html page to another in javascript
If you need to send the data to a new window that you are going to open in that moment, use GET instead and pass the parameters on the url. But, you could create an empty window first, then do your ajax and use the return content to fill your new window. Here is an example fiddle opening the window and filling it with the result of a POST call: http://jsfiddle.net/bxhgr/ var mywindow = window.open(); testArray = [1, 2, 3]; var myUrl = "/echo/json/"; $.ajax({ type: "POST", url: myUrl, dataType: "json", data: { json: JSON.stringify({ images: testArray }) }, success: function (data) { console.log('success'); //alert(data); mywindow.document.body.innerHTML = '<pre>' + data.images + '</pre>'; } });

Categories : Javascript

Cant pass date from Javascript into HTML page
var timecreation=document.createTextNode("p"); should be var timecreation=document.createElement("p"); You cannot append to a text node. JSFiddle Demo

Categories : Javascript

disabling javascript on HTML print page
after edit you can use window.onbeforeprint = function() { } and window.onafterprint = function() { } ook on webkit this should works var mediaQuery = window.matchMedia('print'); mediaQuery.addListener(function(mql) { if(mql.matches) { console.log('before print'); } else { console.log('after print'); } });

Categories : Javascript

Need to tally certain items on HTML page with JavaScript
have a look here, using jquery: http://jsbin.com/opesok/1/edit code var ignored = [40]; //var ignored = [40, 20]; //another example var redFlagTotal = 0; $(".flag-red").each(function(){ var re = /((.*?))/; var text = re.exec($(this).siblings(".col-question").text())[1]; if(ignored.indexOf(parseInt(text)) < 0) redFlagTotal++; }); alert("Tot: "+redFlagTotal)

Categories : Javascript

Inserting HTML comments onto page using Javascript
If you use the old-fashioned view source tool, you will probably see the original source. You can verify the changes in FF by using the Inspect Element array of tools. They show the current DOM, after updates.

Categories : Javascript

How would I change the HTML structure of a page using javascript?
The way jquery works is that you set up a listener to a certain event with custom code to run whenever that happens. Here's an example for the link: <a id="mylink" href="home.html">Go Home</a> The javascript(put this in between your and tags): <script type="text/javascript"> $(document).ready(function() { //This code gets run when the page is finished loading $('a#mylink').click(function() { //Handle the event here }); }); </script> You also asked how you can change HTML dynamically at run time. jQuery has a great function for this .html() Say you have some html: <div id="changeme">Hello</div> The following jQuery: $('#changeme').html("Goodbye"); Changes the page's html to the followi

Categories : Javascript

javascript showing up as text on my HTML page
<img src="images/100_0350a.jpg" name="slide" width="400" height="400> You should properly close this. <img src="images/100_0350a.jpg" name="slide" width="400" height="400" />

Categories : Javascript

How do I load a nested web page in a
AJAX is what your assignment is looking for. Simple Example HTML: <button id="nav">load</button> <div id="page"></div> JS: document.getElementById('nav').onclick = function(){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange=function() { if (xhr.readyState==4) { document.getElementById("page").innerHTML = xhr.response; } } xhr.open("GET", "http://www.codecademy.com/", false); xhr.send(); } fiddle: http://jsfiddle.net/DZmBG/3/

Categories : Javascript

Get HTML content from page rendered by javascript
something like this? console.log(document.getElementsByTagName('html')[0].innerHTML); or document.documentElement.outerHTML per dan

Categories : C#

Getting HTML source of a page by JavaScript and overwriting it
Try something like this to get the page source: document.documentElement.innerHTML And this to change it: document.documentElement.innerHTML = '<body>I like pie</body>' document.documentElement is the <html> ... </html> element on the page, and innerHTML will give is the HTML of it.

Categories : Javascript

How can I change the content of the "h1" tag of an html page using javascript?
If you're sure you only have one h1 tag you could simply do window.onload = function () { document.getElementsByTagName("h1")[0].innerHTML = "header 1"; } if multiple h1 tags are present you could do window.onload = function () { var h1Elems = document.getElementsByTagName("h1"); var pos; for (pos in h1Elems) { h1Elems[pos].innerHTML = "header 1"; } }

Categories : Javascript

Html Page Search Intercept (JavaScript)
Hmm, this is cool. I'd never thought about doing that. Sadly you can't though. You might be able to capture the search string with a plugin, but seeing as this is for analytics it wont get you the result you want. I tested this in Chrome, and when you press ctrl+f you will see the ctrl press, but not f. So you can't even detect when someone searches. You can detect ctrl+f. Use keydown instead of keypress. I found it here: Stop browser from auto scrolling when searching document (ctrl + f) window.addEventListener("keydown",function (e) { if (e.keyCode === 114 /* F3 */ || (e.ctrlKey && e.keyCode === 70) /* ctrl+f*/ ) { e.preventDefault(); } });

Categories : Javascript

Showing html page inside a php page by echo the html page contents
hmm, a simple html page: <html> <head> <title>Page title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="your-style-file.css" media="all" /> <script type="text/javascript" src="your-javascript-file.js"></script> </head> <body> <div id="div-tag">A div tag</div> <script type="text/javascript" src="another-javascript-file.js"></script> </body> </html> You can load external html file via javascript (or jquery load()). like this: $('#div-tag').load('external-file.html'); Or via php, like this: $external-html = file_get_contents('external-file.html'); print $external-html; Check your javascript, mayb

Categories : PHP

How to update javascript variable value in html without a page refresh
If it's going to update whenever you type into the input, you need an event handler: document.getElementById('num').onkeyup = function() { var a = 1000 + parseFloat(this.value); document.getElementById("test").innerHTML = a || 0; } FIDDLE

Categories : Javascript

Using Javascript to load an html page inside an iframe
You can do it this way. function selectCountry(){ var mylist=document.getElementById("country"); document.getElementById("frame").src=mylist.value+'.html'; } or mylist.options[mylist.selectedIndex].value value is missing.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.