I have a problem with my batch. XMLStarlet does not show me the complete line.
However, I get with the batch file below only 3DS
and the rest of the line is not shown.
Output should be only the version information from first title
tag line containing 3DS in XML file, e.g. 9.4.0-21 without 3DS.
I would be very glad about any answer.
My batch file:
@echo off
cls
echo.
echo.
echo ----------- Nintendo 3DS Firmware Checker --------------------------------------
echo --------------------- A CMD based Tool -----------------------------------------
echo.
echo.
echo.
httpget http://yls8.mtheall.com/ninupdates/feed.php nintendo3dsupdate.xml
for /f %%i in ('XML.EXE sel -t -v "//channel/item/title" "nintendo3dsupdate.xml"') do set "var111=%%i" >nul
echo.
echo.
echo "%var111%" is the currently 3ds firmware.
echo.
echo.
pause
exit
The content of the XML file nintendo3dsupdate.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
<channel>
<title>Sysupdate Reports</title>
<atom:link href="http://yls8.mtheall.com/ninupdates/feed.php" rel="self" type="application/rss+xml" />
<link>http://yls8.mtheall.com/ninupdates/reports.php</link>
<description>Nintendo System Update Reports</description>
<lastBuildDate>Thu, 11 Dec 2014 23:05:04 +0000</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<item>
<title>3DS 9.4.0-21</title>
<link><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-11-14_07-05-04&sys=ctr]]></link>
<guid isPermaLink="true"><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-11-14_07-05-04&sys=ctr]]></guid>
<description>3DS 9.4.0-21</description>
<pubDate>Thu, 11 Dec 2014 23:05:04 +0000</pubDate>
</item>
<item>
<title>3DS 9.3.0-21 (stage5)</title>
<link><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-45-04&sys=ctr]]></link>
<guid isPermaLink="true"><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-45-04&sys=ctr]]></guid>
<description>3DS 9.3.0-21 (stage5)</description>
<pubDate>Mon, 08 Dec 2014 23:45:03 +0000</pubDate>
</item>
<item>
<title>3DS 9.3.0-21 (stage4)</title>
<link><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-35-04&sys=ctr]]></link>
<guid isPermaLink="true"><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-35-04&sys=ctr]]></guid>
<description>3DS 9.3.0-21 (stage4)</description>
<pubDate>Mon, 08 Dec 2014 23:35:03 +0000</pubDate>
</item>
<item>
<title>3DS 9.3.0-21 (stage3)</title>
<link><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-25-04&sys=ctr]]></link>
<guid isPermaLink="true"><![CDATA[http://yls8.mtheall.com/ninupdates/reports.php?date=12-08-14_07-25-04&sys=ctr]]></guid>
<description>3DS 9.3.0-21 (stage3)</description>
<pubDate>Mon, 08 Dec 2014 23:25:04 +0000</pubDate>
</item>
</channel>
</rss>
The indents are with horizontal tab characters. There are 2 tabs left to <title>3DS 9.4.0-21</title>
.