Questions tagged [xml]

A simple, very flexible text format that stands for eXtensible Markup Language.

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
501 views

Convert Evolution filters.xml file to Thunderbird msgFilterRules.dat?

I migrated evolution to Thunderbird yesterday. I googled for migrate filters, but Evolution stores them as an XML file and Thunderbird stores using a Mork formatted file such as: version=`9` logging= ...
2
votes
0answers
127 views

How to download media content from XML feeds

For the past few years, I've been using Newsboat for to follow RSS feeds with text, and a web-based RSS reader for feeds with images/videos/gifs. However, I'd like to bring all of my RSS feeds over to ...
2
votes
0answers
824 views

convert CDA XML to PDF without *TeX?

Apologies for the hyper-specificity of my requirements, but they are what they are ... summary The box I'm using runs Debian. I want to render a Clinical Document Architecture (CDA) document to PDF ...
2
votes
1answer
1k views

How to count nodes and get attribute value without using xpath

Currently I have a shell script like this: LOGIN=`curl 'https://www.ponta.jp/u/LWAS900/SLWAS900010.htm' -sS | grep '<input type="hidden" name\|<form\|</form'` for i in $(seq $(printf "$...
2
votes
1answer
229 views

Convert / import flat file with multiple records, one variable per line

I am searching for an efficient way using (UNIX) command line tools to read a flat file into a(ny) database, perhaps after first converting to an intermediate structured format, for example XML or csv....
1
vote
0answers
25 views

Is it possible to require both glob and magic specified in mimetype definition?

Given the following freedesktop shared-mime-info file: <?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info&...
1
vote
0answers
144 views

Tool to convert multi-document YAML to XML

Are there any command-line tools to convert YAML to XML? I've seen that there are several websites that offer YAML to XML conversions, however none of them seem to support YAML files containing ...
1
vote
1answer
256 views

How to find max value from specific XML element using a Perl one liner?

I have an XML file with the following syntax <element> <id>0</id> <tag1>something</tag1> ... <tagn>something</tagn> </element> <element> ...
1
vote
1answer
2k views

Posting to socket using curl

I'm struggling to get curl and socat to play nicely together. The situation is the following: I post XML to login to a system. Return message contains authentication token. I post subsequent requests ...
1
vote
0answers
631 views

How to generate a nmap HTML report with python?

Given an .xml output file from a nmap scan, how would you suggest to generate an html report from this file? nmap proposes the following utility with shell (reference): xsltproc xsltproc <nmap-...
1
vote
0answers
129 views

Custom syntax highlighting misbehaving in gedit

For gedit, I'm creating a custom syntax highlighter for a markup-like language that I created to accomplish some natural language manipulation stuff, so I thought I'd get started with the simple ...
1
vote
1answer
678 views

XML Microsoft Word Document

I have a .xml file generated by someone with MS Word and I cannot manage to open it with LibreOffice or other app or change its format. I tried to save a LibreOffice document as "Word 2003 xml" and ...
0
votes
1answer
19 views

xmlstarlet how to select tag immediately before selected tag

I scan scribus SLA files and wish to find the text having some specific paragraph styles. SLA file format is a quite flat XML format and there are several paragraphs in a row, each being separated ...
0
votes
0answers
8 views

Embed arbitrary structured metadata (key-value pairs or XML) into PDFs with XMP?

I have a process that generates PDF files from a source, and another that generates metadata about the same source in XML format. The metadata is structured (multiple levels of elements, innermost ...
0
votes
0answers
13 views

Limit libvirt lxc container filesystem size

I'm running an lxc container through libvirt. First I've created a container with lxc-create -n test-container -t download -- -d ubuntu -r focal -a amd64 Then I create a new virsh guest with virsh -c ...
0
votes
0answers
24 views

Removing malformed elements in XML file using bash script

I have been querying large numbers of records from a database which returns the records in XML format. Occasionally, query errors will cause malformed records to be written which take the form of ...
0
votes
2answers
46 views

search and replace with sed special character

I need to perform search and replace using sed. starting from this sample text for example : <TextView android:textSize="20.0sp" android:...
0
votes
1answer
31 views

xmlstarlet select iteratively multiple occurences of same tag

I am trying to select attribute values within multiple occurrences of same tag using xmlstarlet within a for loop ,but the $i in the iteration is not taking value as expected , I am referencing it as &...
0
votes
0answers
18 views

pdf with form and send mail button that does not work in gnome

I have this pdf form to be filled anytime I need an additional and temporary worker in my restaurant (for example, an additional waiter). The PDF has been created by the government working agency and ...
0
votes
1answer
35 views

Linux remove a occurrence of sentence from a file and add add start and end

I have a script that curl a command to sms gateway to send sms and get xml as response. Each response are appended to a single file for future xsltproc process for creating csv. A single response is ...
0
votes
1answer
463 views

How to convert curl response xml to plain/csv/xls for a total count

I have a script that send sms for a trigger using a sms gateway. The command to send sms used is curl as below: curl 'http://www.example.com/push/server.php?user=******&pass=*******&sid=******...
0
votes
1answer
215 views

I want to add a namespace prefix to the tags of the default name space of an XML document from the shell

I have a SVG file, which is an XML document: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" ...
0
votes
0answers
12 views

Extracting XML forming a resultset like format

I've encountered a case wherein I need to extract values from xml however, the tags are missing. To elaborate, I've manually finger-counted around 5 of the same elements however, one sibling node(...
0
votes
1answer
44 views

Regex groups not greedy?

Are sed matches always greedy? I am trying to use sed to append an XML comment into an XML file as early as possible, which is right after the XML declaration if there is one. Something like this, ...
0
votes
1answer
51 views

Variable not resolving in multi line string assignment

I'm trying to create a shell script which gives a Json block which is used further. The Json block consists of the dynamic components assigned as variables. Below is the code snippet failCount=$(cat ...
0
votes
1answer
43 views

Add some text after the 4 lines of the matching pattern using shell

I have a xml input file which contains below INPUT FILE <Formula> <name>Total Invoices Released</name> <comment></comment> <sumType>Suspense</sumType> <...
0
votes
1answer
14 views

Using XSLT to create elements where there are no corresponding elements as hooks

I have a long HTML table that I am transforming to XML and breaking up into sections. Abbreviated source: <html> <head> <title>Sample doc</title> </head> <body> &...
0
votes
1answer
241 views

Complex string replace - multiple files, multiple different strings, must include certain text

I have a number of XML files (Atlassian Confluence space exports FYI), that I need to parse through to replace certain strings, as long as the line begins with a set string. Here is an example of a ...
0
votes
2answers
196 views

grep or awk to extact xml from log based on search string

I have a log file which has XMLs being logged. I need to search and extract all XML's that have a specific string in the any one of the nodes. e.g. the log file will have mulitple xml's containing ...
0
votes
1answer
229 views

How to parse continuously updated logs containing XML data?

Added the same question in pastebin: https://pastebin.com/QtZKcBic (I see some xml tags are missing here when pasting) I have a requirement to read from a continuously running logs which refreshes in ...
0
votes
1answer
195 views

Get the xml nodes where the search text is found

I having a well formatted and Indented xml similar to the below one. I need to get the mono tags which has a text " http://yahoo.com " <root> <mono id="1"> <tag1>http://google.com&...
0
votes
0answers
179 views

Fontconfig error causes SEGFAULT in skype

One day running old 4.3 skype in openSUSE Tumbleweed accidentally got error: > skype Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 13: mismatched tag Segmentation fault (...
0
votes
1answer
287 views

Loop through specific set of directories

The following code loops through ALL directories under current path to perform a count on compressed xml files: for i in *xml.gz; do echo "XML" "${PWD##*/}" "$i" $(gunzip -c $i | echo "scale=0; `...
0
votes
1answer
371 views

XML - Extract two or more tags in only one sentence using sed

I have a xml file with the following structure: <object> <class = "a"> xyz </class> <class = "b"> xyz </class> <class = "c"> xyz </class> <class = "d"&...
0
votes
1answer
29 views

Marking up symbols in a programming language

Given a text file with source code in some language, does anyone know of a command-line tool to markup symbols like identifiers, comments etc and output an XML document?
0
votes
0answers
312 views

IzPack Linux Keep same permissions

I'm using IzPack to pack my application contain thousand of files that should be executable. IzPack remove the original permissions and give the unpacked files rw-rw-r-- So, there is any solution to ...
0
votes
1answer
93 views

How to get ids from xml file into mysql?

I've got 8 xml files and need to do some work on these records in mysql. What is a good way to get these IDs into mysql? <?xml version="1.0" encoding="utf-8"?> <Records> <Record> ...
-1
votes
2answers
85 views

Match the pattern and if the pattern is found then comment the tag based on line number

I have the input XML file which looks like below INPUT XML FILE <Formula> <Name>Total Hate Fee</Name> <Code>1234> <Job>BO</Job> <Type>sub</Type> </...
-1
votes
2answers
53 views

How to replace a matching string if n+2 line does not contain a particular string

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/...
-1
votes
3answers
2k views

Edit an xml file - Find a string then Delete a block of text / Find a string then Insert a new block of text

Morning All, I'm new to UNIX so looking to do something I can do in VB but don't have the experience to do in UNIX. I have an xml spec on a share which requires regular deletion and updates as new ...
-1
votes
2answers
42 views

Divide numbers in specific field

I am looking to divide numbers inside the PERCENT="" field in my data that is followed by both START_LV="" and END_LV="". I want to divide the numbers by 5 however the numbers must be whole. Also if ...
-2
votes
1answer
602 views

adding comment tag on XML file through unix

INPUT XML FILE: <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <Dcn xmlns="http://schemas.test.com/2013/ClaimRequest" xsi:schemaLocation="http://schemas.test.com/2013/...
-2
votes
3answers
159 views

Need to parse XML file tag 'Asset Id' & associated child tags using a shell script?

I have the following XML that I'd like to parse/select the 'Asset Id' from using some method from the shell. <?xml version="1.0" encoding="UTF-8"?> <ns0:EcomAssetMetadataTransaction xmlns:...
-2
votes
2answers
97 views

sed giving me this error: … unknown command: `

I have code which will replace the xml tag at a particular line number LineNum=`grep -n "Deep" file.xml | cut -d: -f 1 | awk -F '[\t]' '{$NF = $NF -1;}1'` sed "${LineNum}s#^<...
-3
votes
1answer
136 views

Edit an EBS XML context_file to append a line after a particular one

I have a requirement where I need to add a new entry for the custom top to be created, in the context_file of ebs application installed in Oracle Linux 6. The context_file is an XML file. We need to ...
-4
votes
2answers
383 views

Extract content between tags which is having sub tag

Extract the desired content from the file using "xmlstarlet" or "sed" or "awk" or some similar tool. The process should refer the full name of the particular businessprocesses and then should just ...