how to see ready HTML after xsl-transformation in a browser? - browser

I have xml with header xml-stylesheet that indicates to xsl
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="1.xsl" type="text/xsl"?>
<root>
......
</root>
In a browser this will transform to html. How to see ready HTML after xsl-transformation in the browser? If I choose View Source I see XML of course. I'm interested in Firefox and Explorer

You can use the DOM inspector instead of source viewer.

You could install the FireBug plugin in Firefox, this shows you the currently active DOM, which is your generated HTML.
https://addons.mozilla.org/de/firefox/addon/1843/

Related

The Js and CSS files are not getting compressing in SAFARI browser

I've compressed all the java scripts and style sheets as an individual files, after compression its about 582 KB. While it is loaded in the web page the chrome browser inspect elements network displays 168 KB, similarly when I browse in safari the network displays the file size as un-compressed 582 KB. It seems the compressing process has not occurred.
Many articles says that safari browser wont support the gzip compression.
Please guide me a to roll out this issue.!
Thanks in advance...!!
This is may not be a perfect solution but this may help you
according to http://www.webveteran.com/blog/index.php/web-coding/coldfusion/fix-for-safari-and-gzip-compressed-javascripts/ you may try to send format as "jgz" instead "gz"
according to Why is gzip compression with Internet Explorer not working? you may check whether you are passing correct header
Content-Encoding : gzip
It can also be server side issue
Yes, send as jgz for it to work in Safari and add some headers for IE. Here is a coldFusion example:
<cfheader name="Content-type" value="text/javascript">
<cfheader name="Vary" value="Accept-Encoding">
<cfheader name="Content-Encoding" value="gzip">
<cfheader name="Content-Disposition" value="inline; filename=""#cacheKey#.jgz""">
<cfcontent file="#file#" deleteFile="no">
Alternatively you can opt to not compress the concatenated file in your code, and let your web server do that work for you. Then there is nothing to wonder about. Here is that example code in IIS (web.config):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
...
Live Example using IIS for gzipping. The download is 40KB. The unzipped content is 110KB.
Safari only shows the unzipped size. But firebug shows the download size.

Google Sites Gadget with Javascript

I created a simple slideshow script to include on a Google Site for Google+ albums (it uses a library found at: https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/picasa-services). The test version worked except for the fact that if publish for anonymous access, it displays that aweful "This application was not created by Google" nonsense at the top. As this is a slideshow, I tried finding a way to avoid this. Thus I decided to try my hand at a Gadget. I opted to use Google Gadget Editor and combed through the internet to see how to do this (I am a complete noob with regards to gadgets, so excuse my ignorance...)
In the end I came up with this: http://hosting.gmodules.com/ig/gadgets/file/117039901033759910299/google-plus-slider.xml
Once I insert the gadget, I do not get any error messages and the frame does display on my google site (without the warning message, as far as I can tell), but nothing else happens. And I have no idea why.
Some notes:
the javascript works when it is a google apps script, published and then inserted in my site (but the warning message is ugly)
I have no idea whether it is even possible to call typical GAS calls such as Ui.App in XML gadget - if not, then I will have to learn, but don't know where.
Obviously the library that I am using needs to be loaded - I researched as much as I could but cannot find any way to load the library. The only option I could find was to include specific predefined libraries with the Required tag.
I hope you have all the info and that someone can help! Thanks in advance.
Do you get any Cross-Domain warnings in your console?
I would try and include the external library in your gadget-name.xml file. You're free to include (mostly) whatever JS you like under
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Slider"
height="50"
width="200"
border="none"
/>
<Content type="html">
<![CDATA[
<script type="text/javascript">
function my-slide-show(){
//Dump your lib JS here
}
</script>
<div class="slideshowHtml"></div>
]]>
</Content>
</Module>
This will at least avoid any scoping / Cross origin worries you might be having

HTML5 <audio> tag do not work/play in IE10

I have a page where I display some audio .ogg/.mp3-files for listening in the browser (it is purchased products that are being displayed on a "receipt"-page).
The files are super in Chrome, Opera, Safari and Firefox and I can play them, pause, restart and everything.
Today I use a quick fix and forces the browser if IE to simulate IE7 version and then it works, but is of course prtty ugly-looking. I can also skip the <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> and use compatibility view and get same result.
In IE10 Win7 (got latest version) this is displayed and I cannot even press the play-button: http://snag.gy/kANRy.jpg
You can have a look for yourself at: http://energyshop.se/testry.php/
Also, myclient uses an older version of IE and its the same for her.
I can also add that if Ihit f12 and switch to compatibility view of IE10 the audio WILL be working and im able to listen to them - but not as soon as I unclick compatibility view.
This is the code used for the audio (TEST code) (and heres: http://pastebin.com/ENrPj8cx a full code version of my pdt.php):
<!DOCTYPE html>
<html>
<head>
<title>Tack för Ert köp!</title>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<link rel="stylesheet" type="text/css" href='/phpstyles.css' />
</head>
<body>
<?php
echo("<audio id='testry' controls preload='auto'>");
echo("<source src='/1.mp3' />");
echo("<source src='1.mp3' />");
echo("<source src='1.mp3' />");
echo("<source src='/1.mp3' type='audio/mpeg' />");
echo("<source src='1.mp3' type='audio/mpeg' />");
echo("<source src='/1.mp3' type='audio/mp3' />");
echo("<source src='1.mp3' type='audio/mp3' />");
echo("Your browser does not support the audio tag.");
echo("</audio>");
?>
</body>
</html>
and here is my .htaccess: http://pastebin.com/2mz8QwEV
Also, here is my head, meta and doctype for the page (its a pdt.php)
<!DOCTYPE html>
<html>
<head>
<title>Tack för Ert köp!</title>
<link rel="stylesheet" type="text/css" href='/phpstyles.css' />
<script src="http://api.html5media.info/1.1.5/html5media.min.js"></script>
</head>
I know IE9+ supports .mp3 and I have it updated so whats up? Anyone?
ive seen a very similar issue to this one before. specifically dealing with .ogg and .mp3 file types in IE9 + html5 audio.
problem was resolved by tweaking the MIME type declarations in .htaccess file while the filetypes worked in other browsers just fine - IE9 alone was very picky about what it could work with...
going to investigate further - more info soon.
I am curious what is your hosting situation? (win / linux - self hosted / shared?) i initially assumed shared linux because of the php files as this was the most common scenario.
EDIT:
depending on the hosting situation - (you own the hardware / VPS / or are using shared hosting) some people have found their windows based hosting providers web.config files are in fact overwriting their mime type declarations but i was unable to verfiy as my hosting situation is linux based
after a bit of searching i found a few other documented cases of this issue and some other solutions involved:
for shared / hosted sites, this developer converted his mp3 files to .m4a which had working mime types within IE9
additionally if you are interested this Microsoft Developer Network article - details a bit of the reason why IE9 behaves this way
this stack question is similar to your issue on an Apache Tomcat server
Please check which of this formats are supported on IE: http://textopia.org/androidsoundformats.html. You could be able to inspect with the built-in developer tools and see how it's achieved.
Here, Microsoft Offers a Guide to Using HTML5 Audio.
And here about Unlocking the power of HTML5 .
just to add for completeness, add to your audio element the attribute, type and set this as 'mp3' or 'audio/mpeg' not sure which, but at least then you know for sure the page is clearly informing the borwser the type of the resource you are linking to.
If that doesn't work there aren't other options in HTML to define such resources and I would then be looking at support from IE10 as the issue?
I think this is due to your server not sending back the correct content type for the URLs you provide.
http://energyshop.se/testry.php/1.mp3 gives content type:
Content-Type: text/html; charset=UTF-8
http://energyshop.se/1.mp3 gives content type:
Content-Type: application/octet-stream
I see that you posted your .htaccess file at Why doesn't the audio tag work in IE?
You likely have the octet-stream type set to prompt downloads. Try setting it to "audio/mpeg" instead, and only set "/1.mp3" as the source on the audio tag.

How to use Google Apps Script to serve a Google Calendar/Email gadget?

I would like to develop a calendar/gmail gadget for our Google Apps for Business domain using Apps Script to leverage all of the benefits it affords.
When replicating the Hello World gadget example:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
Using a template XML doGet():
function doGet(e) {
var output = ContentService.createTextOutput();
var xml = '<?xml version="1.0" encoding="UTF-8" ?>\n<Module>\n<ModulePrefs title="Calendar Gadget" />\n<Content type="html"><![CDATA[\nHello, world!\n]]></Content>\n</Module>';
output.setContent(xml);
output.setMimeType(ContentService.MimeType.XML);
return output;
}
The resultant served content is identical to the example Gadget which installs fine, but served from GAS it isn't recognised as valid. Calendar ignores it and GMail declares it invalid.
Invalid gadget specification. Ensure that URL is correct and the gadget does not contain errors.
Is part of the requirement for a Google Apps Gadget that it be served using an *.xml filename?
doGet() does not return the XML (or HTML) verbatim. There is a difference in the exact content provided to the browser and the content returned by doGet().
So, the answer to your question is - yes, you need to have an XML file for a Google Gadget and cannot use Apps Script. What you can perhaps do is use Apps Script to write out the XML file.
The content served using the ContentService should be identical to the input provided. Please ensure that the web app is configured to allow anonymous access.

Adding a sharepoint webpage without storing it in a document library?

I want to do something very simple: Add a "Basic page" to a sharepoint site, and have it appear in the quick launch side navigation. But it insists on storing it in a document library. Is there anyway to not store it in a document library?
You can add the page to the site as a module.
The following XML is how you can register the module for use with SharePoint:
<?xml version="1.0" encoding="utf-8" ?>
<Elements
Id="<GUID />"
xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="<Name />" >
<File Path="<Feature Sub-Directory />"
Url="<URL on SharePoint site />"
/>
</Module>
</Elements>
To get the navigation working use a feature receiver. This is a good place to start for modifying the navigation programmatically: http://msdn.microsoft.com/en-us/library/ms558975.aspx

Resources