05-10-2010
Shell scripting and XML processing are not a happy combination. XML's not line-based, for one thing, quite the opposite. It's not really 'raw text' either; it's encoded in a way with a million and one permutations that must all be abided by to guarantee proper behavior. There's huge C libraries just for properly handling XML. It'd be possible to hack a shell script to handle just this one arrangement of it but if they suddenly change where the line breaks are, it'll stop working...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If someone out there could help me out with this problem. I would really appreciate it.
I am trying to convert xml into text file(fixed length) using Unix Borne shell scripts.
My xml file:
<root>
<header_rec recordtype="00">
<record_id>00</record_id>
<country_code>AK></country_code>... (0 Replies)
Discussion started by: ram2s2001
0 Replies
2. Shell Programming and Scripting
Hi,
This is the xml file that i have.
- <front-servlet platform="WAS4.0" request-retriever="SiteMinder-aware" configuration-rescan-interval="60000">
<concurrency-throttle maximum-concurrency="50" redirect-page="/jsp/defaulterror.jsp" />
- <loggers>
<instrumentation... (5 Replies)
Discussion started by: nishana
5 Replies
3. Shell Programming and Scripting
Dear all,
Can you send me a script file the changes .xml to .csv file.
Thanks,
Srinivasa (4 Replies)
Discussion started by: srinivasaphani
4 Replies
4. Shell Programming and Scripting
Hello Scripting Gurus,
I need help with extracting data from the XML file using shell script.
The data is in a large XML and I need to extract the id values of all completedworkflows. Here is a sample of it. Input and output data is also in the attached text files.
<wfregistry>... (5 Replies)
Discussion started by: yajaykumar
5 Replies
5. Shell Programming and Scripting
I have an xml file:
<AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Table1>
<Data1 10 </Data1>
<Data2 20 </Data2>
<Data3 40 </Data3>
<Table1>
</AutoData>
and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only.
I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies
6. Shell Programming and Scripting
I would like to convert one form of xml tag data to another
<DescriptionList>
<DescriptionExt language="en" shortDesc="ITALIAN SAUSAGE SUB" longDesc="" sizeDesc="" smallImage="Pictures\sub-italian-sausage.png" largeImage="" forceImageUpdate="yes" />
... (1 Reply)
Discussion started by: saisus
1 Replies
7. UNIX for Advanced & Expert Users
Hi,
I want to convert a 3-column data to 3-row data using shell script. Any suggestion in this regard is highly appreciated.
Thanks. (4 Replies)
Discussion started by: sktkpl
4 Replies
8. Shell Programming and Scripting
Hi,
Can anybody help to solve this. I want to parse some xmldata along with the URL in the Shell.
I'm calling the URL via the curl command
Given below is my shell script file
export... (7 Replies)
Discussion started by: Megala
7 Replies
9. Shell Programming and Scripting
Hello,
I am working on a part of code where I need a awk or shell script to convert the given XML file to CSV or TXT file.
There are multiple xml files and of different structure, so a single script is required for converting data.
I did find a lot of solutions in the forum but... (16 Replies)
Discussion started by: Rashmitha
16 Replies
10. Shell Programming and Scripting
hi all, here is the sample log file and these errors are repeated in log file..
i need all the repeated time stamp ,severity and message tags needs to print in output file.. through shell script
<log-message>
<timestamp>2019-03-13T04:52:49.648-05:00</timestamp>
<severity>ERROR</severity>... (17 Replies)
Discussion started by: ravi
17 Replies
LEARN ABOUT SUSE
xmlstarlet
XMLSTARLET(1) xmlstarlet Manual XMLSTARLET(1)
NAME
xmlstarlet - command line XML/XSLT toolkit
SYNOPSIS
xmlstarlet [<options>] [<command>] [<cmd-options>]
INTRODUCTION
XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files us-
ing simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.
This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for auto-
mated XML processing with shell scripts.
OPTIONS
--version
Display the version of xmlstarlet.
--help Display help.
COMMANDS
Type: xml <command> --help <ENTER> for command help
Available commands include:
ed (or edit)
Edit/update XML document(s).
sel (or select)
Select data or query XML document(s) (XPATH, etc).
tr (or transform)
Transform XML documents(s) using XSLT.
val (or validate)
Validate XML document(s) (well-formed/DTD/XSD/RelaxNG).
fo (or format)
Format XML document(s).
el (or elements)
Display element structure of XML document.
c14n (or canonic)
XML canonicalization.
ls (or list)
List directory as XML.
esc (or escape)
Escape special XML characters.
unesc (or unescape)
Unescape special XML characters.
pyx (or xmln)
Convert XML into PYX format (based on ESIS - ISO 8879).
p2x (or depyx)
Convert PYX into XML.
REFERENCES
XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.source-
forge.net/).
AUTHOR
Mikhail Grushinskiy.
XMLSTARLET(1)