Notes by nogeek
Displaying keyword search results 1 - 6
Created by nogeek on April 07, 2011 21:30:54
Last update: April 07, 2011 21:30:54
This is the opposite of parsing. You can use javax.xml.transform.Transformer to output a DOM tree to a file.
import java.io.*;
import javax.xml.parsers.Docu...
Created by nogeek on April 07, 2011 21:07:55
Last update: April 07, 2011 21:07:55
You can use the javax.xml.transform.Transformer class to "transform" an XML stream (string in this case) to a DOM tree - effectively parsing the XML string.
import java.io.*;
import javax.xml.transform.Tr...
Created by nogeek on April 07, 2011 20:54:17
Last update: April 07, 2011 20:54:17
Use javax.xml.parsers.DocumentBuilder to parse xml. DocumentBuilder.parse() takes:
java.io.File
org.xml.sax.InputSource
java.io.InputStream
java.lang.String as a URI to an XML document
Example code:
import java.io.*;
import javax.xml.parsers.Docu...
Created by nogeek on February 08, 2011 13:46:18
Last update: February 08, 2011 13:46:18
Simple Java code that does XSLT on an XML file. The transform results go to STDOUT.
import java.io.*;
import javax.xml.parsers....
Created by nogeek on November 04, 2010 20:00:15
Last update: November 05, 2010 14:38:43
Following are some bugs in the Xalan jar shipped with JBoss 5.1.0 GA and JBoss 6.0. The Xalan jar file is located in jboss-5.1.0.GA/lib/endorsed ( %JBOSS_HOME%/common/lib for JBoss 6.0).
Test xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
...
Test xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs...
XSLT Java code:
import org.w3c.dom.*;
import javax.xml.parsers....
DateUtil.java
import java.util.Date;
public class DateUti...
XSLT output:
Transformer Factory class: class org.apache.xalan....
Apparently, the output is wrong. The string "A test event" should not have been displayed.
Created by nogeek on June 01, 2010 14:34:12
Last update: June 01, 2010 14:34:12
Test with curl and default Apache doc.
C:\>curl --dump-header - http://localhost
HTTP/...