Click here to Skip to main content
16,006,440 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Could not load file or assembly Pin
ArpitDubey28-Dec-12 8:50
ArpitDubey28-Dec-12 8:50 
QuestionHow should I measure scroll position in different browsers Pin
woomla17-Dec-12 21:52
woomla17-Dec-12 21:52 
AnswerRe: How should I measure scroll position in different browsers Pin
Zaf Khan19-Dec-12 5:46
Zaf Khan19-Dec-12 5:46 
QuestionBest Web Technologies Pin
emadns12-Dec-12 3:40
emadns12-Dec-12 3:40 
AnswerRe: Best Web Technologies Pin
David Mujica12-Dec-12 4:22
David Mujica12-Dec-12 4:22 
AnswerRe: Best Web Technologies Pin
achantayamini17-Dec-12 22:05
achantayamini17-Dec-12 22:05 
AnswerRe: Best Web Technologies Pin
jfmorgan33331-Dec-12 10:01
jfmorgan33331-Dec-12 10:01 
QuestionJSP and JSTL and so on ... Pin
SheraX11-Dec-12 6:20
SheraX11-Dec-12 6:20 
AnswerRe: JSP and JSTL and so on ... Pin
fjdiewornncalwe11-Dec-12 6:28
professionalfjdiewornncalwe11-Dec-12 6:28 
GeneralRe: JSP and JSTL and so on ... Pin
SheraX11-Dec-12 6:32
SheraX11-Dec-12 6:32 
GeneralRe: JSP and JSTL and so on ... Pin
AnalogNerd11-Dec-12 7:03
AnalogNerd11-Dec-12 7:03 
GeneralRe: JSP and JSTL and so on ... Pin
SheraX11-Dec-12 7:12
SheraX11-Dec-12 7:12 
QuestionSMTP Programming Pin
Dominick Marciano9-Dec-12 13:49
professionalDominick Marciano9-Dec-12 13:49 
AnswerRe: SMTP Programming Pin
vbmike10-Dec-12 8:49
vbmike10-Dec-12 8:49 
GeneralRe: SMTP Programming Pin
Dominick Marciano10-Dec-12 13:30
professionalDominick Marciano10-Dec-12 13:30 
GeneralRe: SMTP Programming Pin
Richard MacCutchan10-Dec-12 21:36
mveRichard MacCutchan10-Dec-12 21:36 
GeneralRe: SMTP Programming Pin
Dominick Marciano11-Dec-12 9:40
professionalDominick Marciano11-Dec-12 9:40 
GeneralRe: SMTP Programming Pin
Richard MacCutchan11-Dec-12 10:26
mveRichard MacCutchan11-Dec-12 10:26 
GeneralRe: SMTP Programming Pin
Dominick Marciano11-Dec-12 10:44
professionalDominick Marciano11-Dec-12 10:44 
GeneralRe: SMTP Programming Pin
Richard MacCutchan11-Dec-12 10:58
mveRichard MacCutchan11-Dec-12 10:58 
GeneralRe: SMTP Programming Pin
Dominick Marciano11-Dec-12 11:20
professionalDominick Marciano11-Dec-12 11:20 
QuestionXSLT Transforms - how to get just some of in a for-each Pin
QuickBooksDev8-Dec-12 2:26
QuickBooksDev8-Dec-12 2:26 
AnswerRe: XSLT Transforms - how to get just some of in a for-each Pin
Chris Grove13-Dec-12 19:46
Chris Grove13-Dec-12 19:46 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
QuickBooksDev17-Dec-12 0:42
QuickBooksDev17-Dec-12 0:42 
GeneralRe: XSLT Transforms - how to get just some of in a for-each Pin
Chris Grove17-Dec-12 3:43
Chris Grove17-Dec-12 3:43 
Hi,
I haven't done anything like this before but I did a quick bit of hunting around and something like this might do it for you. Please note this is totally untested and is just an idea. I thought about how to do a while or a normal for loop in XSL and then try and find away of checking if the <opt> element at position x existed. This is cobbled together from a couple of SO posts and my own take on how to put it together.

Sources:
http://stackoverflow.com/questions/11127693/how-to-do-a-while-like-loop-in-xslt[^]
http://stackoverflow.com/questions/5791053/xslt-if-tag-exists-apply-template-if-not-choose-static-value[^]
http://www.sourceware.org/ml/xsl-list/2000-08/msg01503.html[^]

From those articles this is what I have cobbled together:
XML
<xsl:template name="for_loop">
	<xsl:param name="num">1</xsl:param> <!-- param has initial value of 1 -->
	<xsl:param name="limit"></xsl:param> <!-- this should be the expected number of opt elements, passed into the template -->
	<xsl:if test="not($num = $limit)">
		<xsl:choose>
			<xsl:when test="not(opt[position() = $num)"> <!-- true if the element DOES NOT exist -->
				<!-- create your empty xml here -->
			</xsl:when>
			<xsl:otherwise>
				<!-- the element exists get the data and output that -->
			</xsl:otherwise>
		</xsl:choose>
		<xsl:call-template name="for_loop">
			<xsl:with-param name="num">
				<xsl:value-of select="$num + 1">
			</xsl:with-param>
                        <xsl:with-param name="limit">
				<xsl:value-of select="$limit">
			</xsl:with-param>
		</xsl:call-template>
	</xsl:if>
</xsl:template>


Hope this helps.

Chris

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.