473,322 Members | 1,846 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,322 software developers and data experts.

XML and XSL through MSXML

I have a webpage where I'm opening an XML page with MSXML, pushing it
through an XSL file to generate some HTML which is incorporated into
the body of the main HTML page. I have other pages where this all
works great. One page, however, seems to bypass the a for-each
iteration, and I can't understand why. I've used XMLSpy to validate
the XML and XSL, and as far as I can see, the simulated generation
through XMLSpy is correct.

Here is a sample of my XML, XSL.
---------------------------------------------------------
<?xml version="1.0" standalone="no" ?>
<WCP>
<action type="get_stats">
<swbf stattype="summary">
<hostname>1.2.3.4</hostname>
<port>12345</port>
<gamename>Blah</gamename>
<mapname map="map1">Unknown</mapname>
<maxplayers>25</maxplayers>
<players numplayers="2">
<member kills="1" deaths="2">Bob</member>
<member kills="1" deaths="2">Tim</member>
</players>
<status>0</status>
<detailsURL>
<![CDATA[ <a
href="swbf_details.asp?host=1.2.3.4&port=12345">De tails</a>
]]>
</detailsURL>
</swbf>
</action>
</WCP>
---------------------------------------------------------

---------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="html" />

<xsl:template match="/WCP/action/swbf">
<xsl:if test="@stattype='summary'">
<xsl:value-of select="hostname" />:<xsl:value-of select="port"
/><br />
<xsl:choose>
<xsl:when test="players/@numplayers = 0">
No players currently in the game
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="players/member">
<xsl:value-of select="text()" /> -
<xsl:value-of select="@team" /> -
<xsl:value-of select="@kills" /> -
<xsl:value-of select="@deaths" /><br />
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------

When the above XML is pushed through the XSL stylesheet with MSXML,
only the host name will show up. But when run through XMLSpy, the
hostname and all the players show up.

Any ideas? Thanks!

Jul 20 '05 #1
0 1273

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

Similar topics

1
by: OKI | last post by:
Hi. I´ve made a XML parser using MSXML2.LIB in a computer. When i´ve tried to run it in another one like that: HRESULT hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,...
6
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
3
by: Daniel | last post by:
Are the differences between MSXML and .Net XSL transformation documented online anywhere? Many of my XSL's work in MSXML but transform differently in ..Net XSL transformation.
4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
0
by: MLH | last post by:
In the following code snippet, notice ("PIN=1234567890&MSSG=Here+is+a+short+message+-+no+spaces+-+just+plusses&Q1=0") I have it that way because I thought PLUSes were required and that spaces...
1
by: Michael Nemtsev | last post by:
Any kind of differences? Were they buid on the common base or different? -- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/laflour "At times one remains faithful to a cause only...
3
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
19
by: Matthias Truxa | last post by:
Hello, can anyone confirm the existence of the following effects which I'd consider being a critical bug in msxml according to w3c's xpath specs? The Spec says: "The parent, ancestor,...
4
by: mrjaxon | last post by:
I have a C# web application which leverages MSXML that I am trying to migrate to a 64 bit environment. Currently the application is built on the .NET 2.0 Framework and using MSXML 6 (though I had...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.