Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an xml which contains an Array for which i am writing xslt . here is the sample xml .
<ScheduleMaintenanceDetails>
<MaintenanceTasksList>
		<MaintenanceTask>
				<intervalNote/>				
				<operCondSort>2</operCondSort>
				<servItemSort>10</servItemSort>
				<servActionSort>70</servActionSort>
			</MaintenanceTask>
			<MaintenanceTask>
				<intervalNote/>			
				<operCondSort>2</operCondSort>
				<servItemSort>210</servItemSort>			
				<servActionSort>60</servActionSort>
			</MaintenanceTask>
			</MaintenanceTasksList>
	</ScheduleMaintenanceDetails>
	<ScheduleMaintenanceDetails>
<MaintenanceTasksList>	
		<MaintenanceTask>
				<intervalNote/>			
				<operCondSort>6</operCondSort>
				<servItemSort>10</servItemSort>				
				<servActionSort>70</servActionSort>
			</MaintenanceTask>
			<MaintenanceTask>
				<intervalNote/>		
				<operCondSort>15</operCondSort>
				<servItemSort>10</servItemSort>			
				<servActionSort>70</servActionSort>
			</MaintenanceTask>
	</ScheduleMaintenanceDetails>


when i am using this xslt code ,

<xsl:for-each select="ScheduleMaintenanceDetails/MaintenanceTasksList/MaintenanceTask">
      
<xsl:value-of select=".//operCondSort" />
<xsl:value-of select=".//servItemSort" /></td>
        <xsl:value-of select="./servActionSort" />



this is only returning value for the 1st list but iteration is not moving to the 2nd array . can anybody help me on this please . I want to retrieve value from both the
MaintenanceTasksList
. Can anybody help me on this please .
2	10	70
2	210	60
2	280	120


What I have tried:

i tried this xslt
<pre><xsl:for-each select="ScheduleMaintenanceDetails/MaintenanceTasksList/MaintenanceTask">
      
<xsl:value-of select=".//operCondSort" />
<xsl:value-of select=".//servItemSort" /></td>
        <xsl:value-of select="./servActionSort" />
Posted
Updated 28-Jan-20 11:24am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900