[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Msxml4 node-set and Filters bug

Subject: Msxml4 node-set and Filters bug
From: "Henk J Meulekamp" <henkmeulekamp@xxxxxxxxx>
Date: Mon, 11 Nov 2002 13:15:10 +0100
msxml4 parser
Hello group,

I'm having a problem (possible bug) with msxml4 parser and the node-set
ext. function. I'm generating a small RTF to reduce the number of loops
and thereby the process time.

I tried to cut-out a small part from my styleseheet. The node-set
function itself is working, but after that some things stop working.

Below you find my source XML, I cut out most not needed parts, it then
generate a nodeset with the xml below:
<!----------------------------------->
<xsl:variable name="learningobjects">
		<xsl:element name="learningobjects">
		<xsl:for-each
select="/root/data/COURSE/RESULT[not(@IDLEARNINGOBJECT  =
preceding::node()/@IDLEARNINGOBJECT)]">
			<xsl:element name="lo"><xsl:attribute
name="id"><xsl:value-of select="@IDLEARNINGOBJECT"/></xsl:attribute>
					<xsl:attribute
name="cname"><xsl:value-of select="@CLEARNINGOBJECT"/></xsl:attribute>
			</xsl:element>
		</xsl:for-each>
			</xsl:element>
	</xsl:variable>

It generates this: 
<!----------------------------------->
  <learningobjects>
  <lo id="46" cname="Deze training" /> 
  <lo id="47" cname="Gedachtevorming" /> 
  <lo id="48" cname="Theorie" /> 
  <lo id="50" cname="Transferdag" /> 
  </learningobjects>


I've then replaced this part below which was working well:
<!----------------------------------->
<xsl:for-each select="/root/data/COURSE/RESULT[not(@IDLEARNINGOBJECT  =
preceding::node()/@IDLEARNINGOBJECT)]">
	<xsl:variable name="lo" select="@IDLEARNINGOBJECT"/-->
	
-<xsl:value-of select="$lo"/>-<xsl:value-of
select="/root/data/COURSE/RESULT[@IDLEARNINGOBJECT=
$lo]/@CLEARNINGOBJECT"/>
   		</xsl:for-each>		



<!-- 
The part above show me numbers and names


The new code looks like this below, usign the node-set ext. fucntion.-->


<xsl:for-each
select="msxsl:node-set($learningobjects)/learningobjects/lo"><xsl:variab
le name="lo" select="@id"/>
 					-<xsl:value-of
select="$lo"/>-<xsl:value-of
select="/root/data/COURSE/RESULT[@IDLEARNINGOBJECT=
$lo]/@CLEARNINGOBJECT"/>

		      <!--<xsl:value-of select="@cname"/>-->&#160;

   		</xsl:for-each>		
<!-- 
It doesn't show me the names anymore.. The statement:<xsl:value-of
select="$lo"/> is still showing the same Id list, but 
<xsl:value-of select="/root/data/COURSE/RESULT[@IDLEARNINGOBJECT=
$lo]/@CLEARNINGOBJECT"/>

Doesn't show me the names anymore. It looks like the part in between []
arent doeibng anything anymore. I can put [@IDLEARNINGOBJECT= 46] in it,
but even then it doesn't give me a name ( value of @CLEARNINGOBJECT).

Is this a known bug in MSXML4?

Regards
Henk Meulekamp



<!-----big XML---------------------------------------->
<root><data><COURSE><RESULT IDUSER="562" CUSERNAME="d_31_test2"
CTYPENAME="amsterdam" IDCOMPANY="31" IDLOCATION="99" IDFUNCTION="41"
IDDEPARTMENT="43" NUMSTUDIED="0" NUMTOSTUDY="1" DONE="0"
IDLEARNINGOBJECT="50" CLEARNINGOBJECT="Transferdag"></RESULT><RESULT
IDLEARNINGOBJECT="46" CLEARNINGOBJECT="Deze training"></RESULT><RESULT
IDLEARNINGOBJECT="47" CLEARNINGOBJECT="Gedachtevorming"></RESULT><RESULT
IDLEARNINGOBJECT="48" CLEARNINGOBJECT="Theorie"></RESULT><RESULT
IDLEARNINGOBJECT="50" CLEARNINGOBJECT="Transferdag"></RESULT>
<!--..Many more..-->
</COURSE></data></root



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.