Simple XML Creator

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple XML Creator

ZuLuuuuuu
Hello,

This is an extremely simple XML creator to create simple XML files quickly. The usage is like this:


 html := XMLNode new: 'html'.

 body := html add: (XMLNode new: 'body').
 body at: 'bgcolor' put: '#ff0000'.

 h1 := body add: (XMLNode new: 'h1').
 h1 value: 'My Heading'.

 p := body add: (XMLNode new: 'p').
 p value: 'My paragraph'.

 html fileOut: '/home/myhome/sample.xml'.


Which creates an XML file with the following output:


 <html>
 	<body bgcolor="#ff0000">
 		<h1>My Heading</h1>
 		<p>My paragraph</p>
 	</body>
 </html>


You can download the package from:

http://www.canol.info/smalltalk/SimpleXMLCreator.star
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: Simple XML Creator

ZuLuuuuuu
Looks like some mail readers try to render the html tags inside my previous message. So here is a blog entry version of my previous message:

http://smalltalk.gnu.org/blog/zuluuuuuu/simple-xml-creator

Sorry for the inconvenience.
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: Simple XML Creator

ZuLuuuuuu
I made the package available to be downloaded via gst-package so you can now download the package via:

gst-package --download SimpleXMLCreator -t ~/.st

or from:

http://www.canol.info/smalltalk/packages/SimpleXMLCreator.star
Canol Gökel