XML/HTML help

ming

OSNN Advanced
Joined
17 Jun 2003
Messages
4,252
Hi all

I'm a noob when it comes to design and coding. Have no experience with coding and stuff so I'd like to ask for some quick help with xml/html.
Basically, I've got a .xml file on my drive which I'd like to display as an html file but have no idea what I need to do to get it to show it.
To be more precise, I'm using Azureus which has generated stats into the xml file.
Can someone guide me on how I can get the coding in html to show up in a web browser?

I've come across this code in w3cschool but don't know how to change elements of it to accommodate the stuff for the my stats xml file.
Code:
<html>
<body>
<xml
src="cd_catalog.xml"
id="xmldso"
async="false">
</xml>
<table
datasrc="#xmldso"
width="100%"
border="1">
<thead>
<th>Title</th>
<th>Artist</th>
<th>Year</th>
</thead>
<tr align="left">
<td><span datafld="TITLE"></span></td>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="YEAR"></span></td>
</tr>
</table>
</body>
</html>

I can see that the
<xml
src="cd_catalog.xml" part is the file name, but what is the id="xmldso"
async="false" part?
 
Have you simply tried renaming it to .html, I know this shouldn't work, but I have come accross some files that can do that.
 
never tried... but then again, Azureus wouldn't be able to update the file if I did rename the file.
 
Ok, please explain again.

What are you doing with this file, is this a file you downloaded as a torrent, your trying to convert it to html and reupload it?

I'm abit confused...
 
You will need to use XSLT to transform the document into HTML.

What is the format of your XML file you want to convert to HTML?
 
I've got a .xml file on HDD, trying to get it to show up in web browser to show the statistics of Azureus... maybe as a table.

Because I have no idea about html/xml coding, I don't know what I'm doing and what I'm supposed to do to get it to display properly in the browser.
 
Geffy is right with XSLT, shouldn't Azureus have something to automaticly show you those statistics?
 
You will need to use XSLT to transform the document into HTML.

What is the format of your XML file you want to convert to HTML?


err... only know it's a .xml file. :p
<?xml version="1.0" encoding="UTF-8" ?>
 
OK, managed to get the xml file to show up how i want it to show it.
However, how can I convert the date from "1147096254" to 01/01/2006 or 01/01/06? Also, how can I add a decimal to a number if the xml updates in integer?
 
can you paste a copy of your XML file here, or PM me a copy and I can try to whip up a quick XSLT for you
 
This is what I can see in the xml file generated by azureus... with the exception of the filename. But the xml code is there. :p

Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Az_stats.xsl"?>
<STATS>
    <AZUREUS_VERSION>2.4.0.2</AZUREUS_VERSION>
    <GLOBAL>
        <DOWNLOAD_SPEED>
            <TEXT>0 B/s</TEXT>
            <RAW>0</RAW>
        </DOWNLOAD_SPEED>
        <UPLOAD_SPEED>
            <TEXT>0 B/s</TEXT>
            <RAW>0</RAW>
        </UPLOAD_SPEED>
    </GLOBAL>
    <DOWNLOADS>
        <DOWNLOAD>
            <TORRENT>
                <NAME>abc.txt</NAME>
                <TORRENT_FILE>D:\abd.txt.torrent</TORRENT_FILE>
                <HASH>98123453DB02731217784C1BE3E88AE</HASH>
                <SIZE>
                    <TEXT>922.92 MB</TEXT>
                    <RAW>967789872</RAW>
                </SIZE>
                <PIECE_LENGTH>526288</PIECE_LENGTH>
                <PIECE_COUNT>1146</PIECE_COUNT>
                <FILE_COUNT>1</FILE_COUNT>
                <COMMENT>abc file</COMMENT>
                <CREATED_BY>Azureus/2.4.0.2</CREATED_BY>
                <CREATION_DATE>115434290</CREATION_DATE>
            </TORRENT>
            <DOWNLOAD_STATUS>Queued</DOWNLOAD_STATUS>
            <DOWNLOAD_DIR>D:\abc.txt</DOWNLOAD_DIR>
            <TARGET_FILE>D:\abc.txt</TARGET_FILE>
            <TRACKER_STATUS>Waiting to Scrape</TRACKER_STATUS>
            <COMPLETED>1000</COMPLETED>
            <DOWNLOADED>
                <TEXT>931.60 MB</TEXT>
                <RAW>976646453</RAW>
            </DOWNLOADED>
            <UPLOADED>
                <TEXT>583.73 MB</TEXT>
                <RAW>612753902</RAW>
            </UPLOADED>
            <DISCARDED>
                <TEXT>6.81 MB</TEXT>
                <RAW>7128524</RAW>
            </DISCARDED>
            <DOWNLOAD_SPEED>
                <TEXT>0 B/s</TEXT>
                <RAW>0</RAW>
            </DOWNLOAD_SPEED>
            <UPLOAD_SPEED>
                <TEXT>0 B/s</TEXT>
                <RAW>0</RAW>
            </UPLOAD_SPEED>
            <TOTAL_SPEED>
                <TEXT>0 B/s</TEXT>
                <RAW>0</RAW>
            </TOTAL_SPEED>
            <ELAPSED></ELAPSED>
            <ETA></ETA>
            <HASH_FAILS>0</HASH_FAILS>
            <SHARE_RATIO>631</SHARE_RATIO>
            <TOTAL_SEEDS>0</TOTAL_SEEDS>
            <TOTAL_LEECHERS>0</TOTAL_LEECHERS>
            <PEERS>
            </PEERS>
        </DOWNLOAD>
    </DOWNLOADS>
</STATS>

If it's possible, could you whip up some awesome .xsl code to show advanced statistics? ;) cheers.
 
Looks like azureus includes an XSL file for its stats. Is there a Az_stats.xsl file in the same directory as the XML stats file? If not, try to find it and then copy it into the same directory and then try to open the file with Firefox or something.

if that doesnt work, just want kind of data do you want displayed out of the XML file?
 
Looks like azureus includes an XSL file for its stats. Is there a Az_stats.xsl file in the same directory as the XML stats file? If not, try to find it and then copy it into the same directory and then try to open the file with Firefox or something.

if that doesnt work, just want kind of data do you want displayed out of the XML file?

There is... but I had to create it myself which flopped. :p
I'd like it to show stuff like:

Name of Torrent
Creation Date (in DD/MM/YY format)
Size of Torrent
Downloaded (amount)
Uploaded (amount)
Ratio (D:L) (I couldn't get the decimal to work)
 
argh, thought I had it right, but its just not coming together :p
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back