eclipse: workspace in use message

if it is obvious that no other eclipse instance is running but you have trouble with this message, delete '.metadata/.lock' file at workspace folder.


android: get device's android sdk version


    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.FROYO) {


xsl: linking external css with xsl

Using XSL for dynamic XML manipulation and CSS for static browser output decoration sounds like a reasonable way for me and for the most people who stand closer to CSS than XSL yet.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="sample.js"></script>
    <link rel="stylesheet" type="text/css" href="sample.css"/>


xsl: document.write() is not working

When document.write is not working at xsl with your browser, setting value to DOM node's innerHTML could be an option.

Here's the simple example of xsl file.

<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
    <script type="text/javascript">
        document.write("Hello World by document.write");
    <div class="foo" id="foo1"></div>
    <div class="foo" id="foo2"></div>
    <div class="foo" id="foo3"></div>
    <script type="text/javascript">
        foos = document.getElementsByClassName("foo");
        for(i=0; i<foos.length; i++) {
            foos[i].innerHTML = "Hello World by innerHTML";

If you load this xsl with some dummy xml, IE will print out 'Hello World by document.write' only(by lack of 'getElementsByClassName' support) and FF will print out 'Hello World by innerHTML' 3 times.