Generating XML in bash, need some efficient ideas -
i need generate xml file in bash(i new bash/scripting languages, despite working on c/c++/unix time). right now, generating this, pretty flat
st='<' et='>' sl='/' ------------------- stag() { text=$st$1$et echo $text >> output_file } -------------------- etag() { text=$sl$1 stag $text } -------------------- attr() { text=$1 echo $text >> output_file } -------------------- #--function call stag "tag" attr "xml" etag "tag" -------------------- #--output <tag>xml</tag> in this, feel there lots of chance make errors , after coding in c++ long, think there should better structured way code.... thoughts appreciated.... or material think, should learn first, plz post here.... thanks...
you looking xmlstarlet. depyx subcommand allows convert pyx markup xml.
this may sufficient prototyping purposes. if not, you'll need @ more full-featured xml library in ruby, python, or perl.
Comments
Post a Comment