This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

a novice Q


hi all

a XSLT novice question, and I promise this is not my home work.
I have the following XML :

<Test>
	<Test2>
	<Q>
  		<QT>text 2</QT> 
  		<AT>2</AT>
	</Q>
	<Q>
  		<QT>text 3</QT> 
  		<AT>3</AT>
	</Q>
	<Q>
  		<QT>text 1</QT> 
  		<AT>1</AT>
	</Q>
	</Test2>
</Test>

and the following XSL

	<xsl:template match="Test/Test2/Q">
		<xsl:if test=".[QT/text() = 'text 1' and AT/text() !=
'NULL']">
			<xsl:value-of select="AT"/>
		</xsl:if>
		<xsl:if test=".[QT/text() = 'text 2' and AT/text() !=
'NULL']">
			<xsl:value-of select="AT"/>
		</xsl:if>
		<xsl:if test=".[QT/text() = 'text 3' and AT/text() !=
'NULL']">
			<xsl:value-of select="AT"/>
		</xsl:if>
	</xsl:template>

combine both together I get a blank result. I must have forgot some basic
stuff. 

I wants to display :

1
2
3

Also do I need to sort my XML first into the correct order?

cheers
joe


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]