View Single Post
  #10 (permalink)  
Old February 22nd, 2011, 02:43 PM
chilly chilly is offline
Authorized User
Points: 310, Level: 6
Points: 310, Level: 6 Points: 310, Level: 6 Points: 310, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is my updated code.

The attributeList/attribute is working. The next level set is not working. Can someone take a look at it, the for each takes place but not finding the values at each context.

Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsl:template match="/ematrix/businessObject">
		<xsl:element name="{translate(objectType,' ','')}">
			<Type>
				<xsl:value-of select="objectType"/>
			</Type>
			<Name>
				<xsl:value-of select="objectName"/>
			</Name>
			<revision>
				<xsl:value-of select="objectRevision"/>
			</revision>
			<vault>
				<xsl:value-of select="vaultRef"/>
			</vault>
			<owner>
				<xsl:value-of select="owner/userRef"/>
			</owner>
			<description>
				<xsl:value-of select="description"/>
			</description>
			<originated>
				<xsl:value-of select="creationInfo/datetime"/>
			</originated>
			<modified>
				<xsl:value-of select="modificationInfo/datetime"/>
			</modified>
			<policy>
				<xsl:value-of select="policyRef"/>
			</policy>

			<xsl:for-each select="attributeList/attribute">
				<xsl:call-template name="attribute"/>
			</xsl:for-each>
			<states>
				<xsl:for-each select="stateList/state">

					<xsl:element name="state">
						<xsl:element name="name">
							<xsl:value-of select="name"/>
						</xsl:element>
						<xsl:element name="current">
							<xsl:value-of select="stateStatus"/>
						</xsl:element>
						<xsl:element name="actual">
							<xsl:value-of select="actualInfo/datetime"/>
						</xsl:element>
						<xsl:element name="start">
							<xsl:value-of select="startDate/datetime"/>
						</xsl:element>
						<xsl:element name="end">
							<xsl:value-of select="endDate/datetime"/>
						</xsl:element>
						<xsl:element name="duration">
							<xsl:value-of select="stateDuration"/>
						</xsl:element>
					</xsl:element>
				</xsl:for-each>
			</states>
		</xsl:element>
	</xsl:template>
	<xsl:template name="attribute">
		<xsl:element name="{translate(name,' ','')}">
			<xsl:value-of select="*[2]"/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
Reply With Quote