This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XALAN as the parser

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!




 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic