Recent Notes
Displaying keyword search results 1 - 7
Created by James on November 27, 2011 12:43:24
Last update: November 27, 2011 12:59:01
An easy to digest stylesheet example for XSLT for Atom. Simply list entry titles and summary:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
To show the first 3 items in atom feed:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
Created by James on November 23, 2011 13:57:51
Last update: November 23, 2011 13:57:51
An easy to digest stylesheet example for XSLT for RSS. Simply list item titles descriptions:
<?xml version="1.0" encoding="utf-8"?>
<xsl:sty...
URL for Google news feed: http://news.google.com/news?ned=us&topic=h&output=rss
Created by Fang on November 10, 2011 09:26:12
Last update: November 10, 2011 09:26:12
Syntax highlighted XML schema for JSF 2.0 Application Configuration Resource File ( faces-config.xml ). Almost 3000 lines!
<?xml version="1.0" encoding="UTF-8"?>
<xsd:sch...
Created by nogeek on November 11, 2010 00:26:08
Last update: November 11, 2010 00:29:43
This one is even more weird: it worked on Windows but failed on Linux, using default tools JDK1.6.0_20 on both. The exception thrown was:
java.lang.RuntimeException: Invalid conversion fro...
And the stack trace:
java.lang.RuntimeException: Invalid conversion fro...
This was the XSL used:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
The problem was , DateUtil.java had two getDate methods, one taking long parameter, the other taking a String parameter. And Java's XSLT get confused about which one to use:
import java.util.Date;
import java.text.SimpleD...
Created by nogeek on November 04, 2010 23:25:57
Last update: November 04, 2010 23:26:59
With this XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ev...
and this XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
The output of XSLT is:
A test event
Timestamp: 12886515008...
You may not want the title string in the output. There are two ways to do this:
Limit the apply-templates action with a select attribute:
<xsl:template match="/">
<xsl:apply-templat...
Suppress default text node output with an empty template:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
Reference: http://www.dpawson.co.uk/xsl/sect2/defaultrule.html
Created by nogeek on November 04, 2010 20:24:32
Last update: November 04, 2010 20:24:55
XSLT by default writes namespace declarations in the output. Most of the time it's spurious, sometimes outright wrong.
Take this XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ev...
And this XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
where DateUtil.java is:
import java.util.Date;
public class DateUti...
The output is (with JDK1.6):
Title: <br xmlns:java="http://xml.apache.org/x...
The namespace declaration went to the <br> element, not the timestamp where it belongs.
To remove the namespace info, add exclude-result-prefixes to the XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
Created by Dr. Xi on March 08, 2009 20:42:32
Last update: March 08, 2009 20:43:17
encoding : The 'encoding' option tells Vim the encoding of the characters that you use. This applies to the text in buffers (files you are editing), registers, Vim script files, etc. For example: :set encoding=utf-8 You need to use an appropriate font to display Non-ASCII characters: X Windows: :set guifont=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 Win32: :set guifont=courier_new:h12 , or select one from the Edit/Select Font... menu termencoding : Encoding used for the terminal. For the Win32 GUI 'termencoding' is not used for typed characters, because the Win32 system always passes Unicode characters. fileencoding : When you edit a file, vim tries to detect what kind of file you are editing. It uses the encoding names in the ' fileencodings ' option. When using Unicode, the default value is: "ucs-bom,utf-8,latin1"....