473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="summa ry">
<hostname>1.2.3 .4</hostname>
<port>12345</port>
<gamename>Bla h</gamename>
<mapname map="map1">Unkn own</mapname>
<maxplayers>2 5</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_deta ils.asp?host=1. 2.3.4&port=1234 5">Details</a>
]]>
</detailsURL>
</swbf>
</action>
</WCP>
---------------------------------------------------------

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

<xsl:styleshe et 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="hostnam e" />:<xsl:value-of select="port"
/><br />
<xsl:choose>
<xsl:when test="players/@numplayers = 0">
No players currently in the game
</xsl:when>
<xsl:otherwis e>
<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 1298

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

Similar topics

1
3157
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, IID_IXMLDOMDocument, (void **)&(this->xmlDoc)); the result is:
6
6288
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# extension functions with the MSXML objects? More specifically to use a C# class which has all my extension functions. I've seen examples where the stylesheet uses the <msxsl:script> element and embeds C# code, but that's not a viable solution...
3
3074
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
6902
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 the data in a node. The CString was then display in CListCtrl. For the traditional chinese characters, they were shown correctly, but for simplified characters, I encounted many "?", but some characters were correct.
0
1441
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 would not work. But I have tried ("PIN=1234567890&MSSG=Here is a short message - no spaces - just plusses&Q1=0") and the msXML.Send call works perfectly. Does anyone know how or why the PLUSes came to be used in the first place?
1
2439
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 because its opponents do not cease to be insipid." (c) Friedrich Nietzsche
3
70203
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
25297
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 the version of Microsoft's XML parser and that Microsoft.XMLHTTP refers to the latest installed version. This makes me wonder why sites like <http://developer.apple.com/internet/webcontent/xmlhttpreq.htmlopt to use Msxml2.XMLHTTP, first, and...
19
2625
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, ancestor-or-self, preceding, and preceding-sibling axes are reverse axes" http://www.w3.org/TR/2005/CR-xpath20-20051103/#doc-xpath-ReverseAxis
4
11826
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 the same issues using version 4). The OS I am running the app on is Windows Server 2003 x64. I am using the x64 version of MSXML 6 on the server. My dev environment is Windows XP 32 bit SP2. I have tried to compile the projects for "anycpu"...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.