Strip all tags from an XML file

deneme222

New Member
I have a large XML file I would like to strip all the tags and leave node values only. I want each node value in a separate line. How can I do that?Can I use a free software to do it or use a PHP or ASP.NET Code. I looked at XSLT option also. It is probably too much for RegEX. I explored PHP options looked at \[code\]simplexml_load_file()\[/code\], \[code\]strip_tags()\[/code\], \[code\]get_file_contents()\[/code\] but failed.\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><!-- a comment --><catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <address> <city>Melbourne </city> <zip>01803 </zip> </address> <year>1985</year> </cd> <cd> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd></catalog>\[/code\]Edit: This is what I tried, among other things.\[code\]<?php$xml = simplexml_load_file('myxml.xml');echo strip_tags($xml);?>\[/code\]
 
Back
Top