How can I please turn the below (capital letter tags i.e. <RSS>
and capital letter attributes i.e. TYPE="audio/mpeg"
)
<RSS xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<CHANNEL>
<title>Example Title</title>
<LINK>Example Link</link>
<atom:link HREF="http://example.com/feed" REL="self" TYPE="application/rss+xml"/>
<itunes:subtitle>Example subtitle with itunes namespace</itunes:subtitle>
<itunes:owner>
<itunes:name>OWNER NAME</itunes:name>
<itunes:email>owner@gmail.com</itunes:email>
</itunes:owner>
<ITEM>
<TITLE>Title Name here</TITLE>
<itunes:author>Author name here</itunes:author>
<ENCLOSURE TYPE="audio/mpeg" URL="http://www.podtrac.com/abc.mp3" LENGTH="31805"/>
</ITEM>
</CHANNEL>
</RSS>
Into this (lower case letter tags i.e. <rss>
and lower case letter attributes i.e. type="audio/mpeg"
)
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>Example Title</title>
<link>Example Link</link>
<atom:link href="http://example.com/feed" rel="self" type="application/rss+xml"/>
<itunes:subtitle>Example subtitle with itunes namespace</itunes:subtitle>
<itunes:owner>
<itunes:name>OWNER NAME</itunes:name>
<itunes:email>owner@gmail.com</itunes:email>
</itunes:owner>
<item>
<title>Title Name here</title>
<itunes:author>Author name here</itunes:author>
<enclosure TYPE="audio/mpeg" url="http://www.podtrac.com/abc.mp3" length="31805"/>
</item>
</channel>
</rss>
Using XSLT?
NOTES:
- Needs to be all tags and all attributes that are lowercased, not just my example ones of
<RSS>
to<rss>
, andTYPE="audio/mpeg"
totype="audio/mpeg"
- I will be using PHP to run this
- Please notice the line one namespace setup of
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
inside the<rss>
tag -- this must remain - Please notice the iTunes namespace items such as
<itunes:name>OWNER NAME</itunes:name>
- these must remain exactly the same