This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XALAN as the parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XALAN as the parser" Watch "XALAN as the parser" New topic
Author

XALAN as the parser

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi!

I need to create an xml document. I would get the system date and time and depending on the value, would create an xml document. I need to use XALAN as the parser. Any ideas on how this can be done. Eg: if the system date is 30th March, 2005, then my xml file would be

<calendar>
<year> 2005 </year>
<months>
<month> January </month>
<month> February </month>
<month> March </month>
<months>
<year> 2004 </year>
<months>
<month> January </month>
<month> February </month>
<month> March </month>
<month> April </month> ....
<months>
</calendar>

This xml document should be genearated on the fly.

Any ideas plz help!!!






SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by JayaSiji Gopal:
I need to create an xml document. I would get the system date and time and depending on the value, would create an xml document. I need to use XALAN as the parser. Any ideas on how this can be done.

Well, Apache Xalan is not a parser but an XSLT implementation. What you want is Apache Xerces. I guess you could generate this file using an XSLT stylesheet as well but I'm thinking it should be a lot easier to use the DOM API to construct the XML document programmatically.

See the Java Developer's Almanac for some example code snippets.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
 
subject: XALAN as the parser
 
Similar Threads
display xml as html
display xml as html
crimson error encountered
javacc - communicating from lexer to parser
Convert String to Date