Quantcast
Channel: Active questions tagged xml - Unix & Linux Stack Exchange
Browsing all 36 articles
Browse latest View live

Insert a tag with a unique identifier into a XML

I'm able to add a new node with a custom fixed value to my XML file in this way, with xmlstarlet:xmlstarlet ed --subnode "/legge190/data/lotto" --type elem -n newsubnode \-v "myvalue"But how to add a...

View Article



script to swap strings containing newlines within text file (XML)

I am using Arch which was updated a couple of weeks ago. Packages is use areArch 6.0.10-arch2-1BASH 5.1.16(1)-releasegnu sed 4.9gnu grep 3.8openbox 3.6.1Within my Openbox rc.xml text file I have two...

View Article

Getting specific entries of a log file using awk

I'm currently trying to use awk to grab items from massive log files matching specific criteria. Essentially, I need to be able to pull the entire command, marked by a transaction ID, based on...

View Article

XMLERR: Element '=").*?(?=")

I am trying to use lookaround element in PCRE2 regex for Wazuh tool, i need to match strings which are in double quotes and made the below regex however it looks its picking up "<" character and not...

View Article

Extract string followed by specific word/symbol

I have two lines as shown below in my input file input.txt and I need to extract claimStartDate from first line and claimEndDate from second line.<ProfessionalClaim paymentIndicator="P"...

View Article


create XML file using bash script

I want create simple xml file using bash script ( not with dom )but when I set value in the line then echo print the $lorem word and not the vallorem=LOLecho '<root><foo...

View Article

script to translate xml to json

I have 5000 questions in txt file like this:<quiz><que>The question...

View Article

Image may be NSFW.
Clik here to view.

Cannot Edit KVM Machine's XML; Failed to validate against schema

When trying to save XML changes in Vim this error occurs:error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rngExtra element devices...

View Article


Sum values in xmlstarlet from two siblings?

I am using xmlstarlet to extract text from elements with a specific preceding sibling event. An example from the XML file:<event type='cue'...

View Article


Alternative to xmllint to check xml validity

Sometimes, I have to check the validity of some big xml files against a xsd file.The biggest xml file I received had a size close to 1.5GB.xmllint took all my RAM and almost all the swap space, for a...

View Article

Use xmlstarlet to remove an entire element that matches an attribute value?

My question is similar to sed - Delete XML node containing certain element - Unix & Linux Stack Exchange. Trying to implement the suggestions there has kept me busy all day, but I haven't managed...

View Article

'xmlstarlet edit' using a variable as XPath

When you follow the doc:xmlstarlet edit --helpyou can read that --var can be used to declare a XPath expression as a variable.Generating moc file:cat<<EOF >...

View Article

extract block from XML with different ending tags (... vs )

Given an XML with some blocks ending within the same tag and others with a separate tag:<parent name="parent_1" team="team_a"><child name="child_1" team="team_b"/></parent><parent...

View Article


AIX - Using Sed To Replace A String In A File

On RHEL, I am able to utilize the sed -i command to replace a string within a file, however, on AIX, it seems like the same -i parameter cannot be used.I have a file called abc.xml that contains the...

View Article

libvirt rejects passthrough USB in XML

On a Debian 10 machine, I have a KVM VM with Windows 10. It runs fine. The libvirt version is 5.0.0-4+deb10u1.I want the VM to recognize a video camera that is attached to the Debian host via USB....

View Article


How to remove nodes from XML file as command line with namespace?

I have an xml file that contains the tag </w:rPr> several times.It is used like this<w:rPr> TO REMOVE</w:rPr>However the content between the tag itself is sometimes different. Could...

View Article

Extract value from XML

I have this XML:<results><testsuites><testcase name="XXXX (XXXXX)" time="20.3817"><result>success</result></testcase><total_time value="20.3830"...

View Article


How to add an attribute in a tag in XML file by command-line?

I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file:<book name="Sed tutorial" price="250"/>Now I want to add field as Book_Width="A" after end of...

View Article

How to extract table of contents from fb2 book?

I have a book in fb2 format. I want to print the table of contents, containing names and numbers of "parts", "chapters", "episodes" and so on.Is there a way I can do this from terminal? There is a...

View Article

How can I sort XML elements by their attributes?

How can I sort this XML?first by alphabetical element: module before property.then by the alphabetical name attribute: <module name="ClassTypeParameterName"/> before <module...

View Article
Browsing all 36 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>