• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XML/HTML help

ming

OSNN Advanced
#1
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?
 

Bman

OSNN Veteran Original
#2
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.
 

Bman

OSNN Veteran Original
#4
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...
 
#5
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?
 

ming

OSNN Advanced
#6
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.
 

ming

OSNN Advanced
#9
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?
 

ming

OSNN Advanced
#11
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.
 
#12
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?
 

ming

OSNN Advanced
#13
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)
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,013
Latest member
Pdawgintown