Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within XML
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
XML and Related Technologies
.Xls file for xml to html conversion
S Ag
Greenhorn
Posts: 1
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I want to convert this xml file to a html file, can some one help me in writting the .xsl file required for conversion.
my xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<pmd version="4.2.2" timestamp="2011-06-02T15:23:33.822">
<file name="a.java">
<violation beginline="745" endline="768" begincolumn="17" endcolumn="17" rule="CollapsibleIfStatements" ruleset="Basic Rules" package="xyz" class="myclass.java" method="getSu" priority="3">
These nested if statements could be combined
</violation>
<violation beginline="880" endline="893" begincolumn="17" endcolumn="17" rule="CollapsibleIfStatements" ruleset="Basic Rules" package="xyz" class="myclass.java" method="getSur" priority="3">
These nested if statements could be combined
</violation>
</file>
</pmd>
Java
Code for conversion is:
import javax.xml.transform.*;
import java.net.*;
import java.io.*;
public class Converter {
public static void main(
String
[] args) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer
(new javax.xml.transform.stream.StreamSource
("pmd.xsl"));
transformer.transform
(new javax.xml.transform.stream.StreamSource
("pmd.xml"),
new javax.xml.transform.stream.StreamResult
( new FileOutputStream("pmd.html")));
}
catch (Exception e) {
e.printStackTrace( );
}
}
}
Ulf Dittmer
Rancher
Posts: 43081
77
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Seeing the Java code is not particularly useful; seeing the XSL code you have, and reading how it does not yet do what you need done, would be.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
PMD tool
What is the following XSLT program doing ?
capturing inividaul elements in the xml file
Transformation Problem For Arabic/French Character : HTML to XML
Ruleset not found error while customizing PMD.
More...