Skip to content
Advertisement

Tag: xml

How to make path location dynamic in xml

I have a logback.xml configured in a spring MVC + hibernate project, it is working fine on my local machine. the local machine has windows 10 OS installed. I wish to run the code of production machine which has Linux installed. What is want to know, is there a way to make LOG_PATH and LOG_ARCHIVE locations dynamic according to OS

How can I extract text from between two xml tags using sed

I have the following output from curl: How can I retrieve the text between <id> and </id>? I tried using: but that results in the entire block of text being printed out instead of just the part between and <id>. I don’t have the ability to install programs on this box so I’d rather not go through the hassle of

XSLT: add element, read content from file

I ran into a complicated XSLT question. Input.xml Here I want to add a new element <DESCRIPTION>. The tricky part: the content are in separate files, the file name of the description file is the : (00050802.html,00033802.html === <ID>.html). The .html contains some html code, so the content should be enclosed in CDATA. Output.xml XSLT version does not matter. Answer

XML to postscript using xsltproc

I’m trying to produce a postscript file for an XML document. I can produce a plain text or an html output using xsltproc. Is there a way to produce a postscript file from command line or programmatically using C? Answer One possibility to achieve this is converting the XML-file to XSL-FO and then use Apache-FOP to transform it to a

Merge XML files and delete duplicate rows

I’m using the following script to merge XML files. There are 5 different XML file types, ItemAvailability.xml, ItemUpsert.xml, ItemCatDesc.xml, ItemPrice.xml and ItemDelete.xml. How can I have the same script remove duplicate rows from the combined XML files? I really only need the duplicates removed from the ItemAvailability.xml files, the script is run on a 15-minute interval cron job. Any ideas

Unix – Uncomment xml comments

I have below node from XML file. How do I uncomment the first occurrance of mainHost using Unix shell script or commands? I have tried with below command with different variations but that does not seem to work. sed ‘0,/<!– /{s/<!– //}’ /test.xml I am expecting below output Thanks Answer You were on the right track (under the assumption that

Advertisement