473,385 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

xsl Cannot Pull data from XML sile

Hello I have a very simple xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="./status.xsl"?>

<IEC>
<Workstation>
<Hostname>HOSTNAME</Hostname>
<CurrentPkg>PKGNAME</CurrentPkg>
<TimeRunning>15 min</TimeRunning>
<LastPkg>LastPKGNAME</LastPkg>
<PercentComplete>95%</PercentComplete>
</Workstation>
</IEC>

This file is built from information gathered about the workstation
during a software upgrade.

I am trying to use the following xsl file to pull data into a table.
The result is a table with headings, but the data from the valueof is
not being set.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template>
<html>
<body>
<h2 Workstation Status</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Hostname</th>
<th>Current Package</th>
<th>Time Installing</th>
<th>Last Package</th>
<th>Percent Complete</th>

</tr>

<xsl:for-each select="IEC/Workstation">
<tr>
<td><xsl:value-of select="Hostname"/></td>
<td><xsl:value-of select="CurrentPkg"/></td>
<td><xsl:value-of select="TimeRunning"/></td>

</tr>
</xsl:for-each>

</table>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

Can someone help me please ???
Thx

Jan 1 '06 #1
3 1502


jj************@gmail.com wrote:
<xsl:template>
<html>


I guess you want
<xsl:template match="/">
for a start.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 1 '06 #2
Martin,

Thanks, I did have it that way, I was trying some different thiings and
forgot to put it back in. But I had the same results in both cases.

Thx

jimmy

Jan 1 '06 #3
jj************@gmail.com wrote:
Hello I have a very simple xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="./status.xsl"?>

<IEC>
<Workstation>
<Hostname>HOSTNAME</Hostname>
<CurrentPkg>PKGNAME</CurrentPkg>
<TimeRunning>15 min</TimeRunning>
<LastPkg>LastPKGNAME</LastPkg>
<PercentComplete>95%</PercentComplete>
</Workstation>
</IEC>

This file is built from information gathered about the workstation
during a software upgrade.

I am trying to use the following xsl file to pull data into a table.
The result is a table with headings, but the data from the valueof is
not being set.
It is when I run it through Saxon. What processor are you using?
<h2 Workstation Status</h2>
I had to add the missing ">" between the 2 and the W though.
<xsl:for-each select="IEC/Workstation">


Better and (I believe) more efficient would be to use templates.

<xsl:template match="/">
<html>
<body>
<h2>Workstation Status</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Hostname</th>
<th>Current Package</th>
<th>Time Installing</th>
<th>Last Package</th>
<th>Percent Complete</th>
</tr>
<tr>
<xsl:apply-templates select="IEC/Workstation"/>
</tr>
</table>
</body>
</html>
</xsl:template>

<xsl:template
match="Hostname|CurrentPkg|TimeRunning|LastPackage |PercentComplete">
<td>
<xsl:value-of select="."/>
</td>
</xsl:template>

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Jan 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David | last post by:
Hi, I have a MySQL database and in the front-end software I am using to Run MySQL, I have created a query on the tables which runs in the front-end, similar to the MS Access query grid. I now...
5
by: Julia Baresch | last post by:
Hi everyone, I haven't found any reference to this problem on this group or in Access 97 help. I hope someone here knows this - probably a simple thing, but not obvious. I designed a query to...
2
by: Nick | last post by:
What I want to do is have 2 pull down lists, for example a state pull down list and a city pull down list. What I would like to have done is when you select a state from the state pull down list...
4
by: sparks | last post by:
We have a new project here, one that I have never tried maybe its easy I don't know yet. We have people that have records dating back over 5 yrs on a sql server. We have to build an access 2003...
0
by: yukijocelyn | last post by:
I have experienced a problem here while doing a form for accessing datadbase using MS Access. I'm using the AccessDataSource control, and using Gridview to pull the data from the database. I am able...
1
Echooff3
by: Echooff3 | last post by:
I'm gonna pull my freakin hair out!!! This is the second time I had .Net lock me out of one of my forms with this error. I have a relational dataset and on a particular form there is the master...
3
by: chauser | last post by:
I have a query that is supposed to pull data from the table based on the unit that is selected from a combo box on a form. I have the query pulling a specific unit but I want the user to be able to...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.