Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any XML creator or builder available in shell scripting for creating XML doc and applying a stylesheet?

I need to fetch data from a database and write those records into an XML document. One can create XML in Perl using XML::Writer,XML::LibXML,XML::Smart, etc., but I need to do something similar in shell scripting.

share|improve this question

migrated from stackoverflow.com Dec 14 '11 at 17:35

This question came from our site for professional and enthusiast programmers.

1  
Why can't you have your shell script call Perl? After all, unless your shell supports XML manipulation directly, you'll be calling external programs anyway... –  Rowland Shaw Dec 14 '11 at 13:59
1  
Wait... You know that you can invoke perl from the command line with arguments, and even make it read stdin. In what way doesn't a set of perl scripts invoked from the command line fit your need? –  fge Dec 14 '11 at 13:59
    
0. It may help the solutions offered here if you edit your question to include why you don't want to/can't use perl. 1. Add appropriate tags from S.O. taxonomy to indicate that your question is about XML ;-)! right (there are dozens of them)? There are dozens of XML experts, and apparently, they're not seeing your question. 2. About 1/2 hour of reading here on S.O. with a search target of "[XML] XSLT conversion" should give you a lot of ideas about the large range of tools available. 3. I am absolutely no XML expert, but I have looked into tools for this in the past. xmlstarlet may be a tool –  shellter Dec 14 '11 at 15:50
    
Why must you use shell scripting? As previously stated, perl is available in shell scripting, and can do it, but you do not explain why that is not an acceptable solution. –  Rowland Shaw Dec 16 '11 at 12:04
    
Hi Rowland, As i said i have to use shell script only. I will try using perl and let know about the results. –  Vel Dec 16 '11 at 18:04

1 Answer 1

Have you tried XML::XSH2? It's written in Perl, can be used from Perl, but also features a scripting language of its own.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.