From: <Ste...@zv...> - 2001-10-25 23:52:45
|
Please use the SourceForge mailing list in future: tcl...@li... "Rajapurohit, Sunil" wrote: > I need to generate an XML document using a tcl script, how do i > go about generating the same ? When creating XML, I generally use TclDOM. Create a DOM tree in memory, and then use 'dom::DOMImplementation serialize $doc' to generate the XML. The TclDOM package will make sure that the generated XML is well-formed. Alternatively, XML is just text so there's no reason why you can't just create the string directly. Eg: puts "<document>$content</document>" The problem with this is that (a) you have to worrying about the XML syntax nitty-gritty and (b) the content variable may contain special characters which you have to deal with. There are also some generation packages available, like the 'html' package in tcllib (this will be added to TclXML RSN, when my workload permits). Hope that helps, Steve Ball -- Steve Ball | XSLT Standard Library | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Ste...@zv... +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 |