jmc430
asked on
XSLT Tag - Hidden Input Form Fields
Hi,
If I have an XML file with multiple criteria (namely, Lastname, Insurance, Language):
<Params>
<Criteria>
<Criterion>
<Type>Lastname</Type>
<Name>S</Name>
</Criterion>
<Criterion>
<Type>Insurance</Type>
<Name>Empire Health</Name>
</Criterion>
<Criterion>
<Type>Language</Type>
<Name>French</Name>
</Criterion>
</Criteria>
</Params>
How would I be able to submit all these values as hidden input form fields in my XSLT?
I am already sending in SessionID:
<input type="hidden" name="SessionID" value="{@SessionID}">
and a single Search Criterion:
<input type="hidden" name="{Params/Criteria/Cri terion/Typ e}" value="{Params/Criteria/Cr iterion/Ty pe}">
I fear I am missing the situation where multiple search criteria are within the XML and will not be returned. .. How would I iterate between all the values within the Criterion, so as to not miss sending those Criterion values in?
Any advice or guidance is greatly appreciated!
Best regards,
Jamie
If I have an XML file with multiple criteria (namely, Lastname, Insurance, Language):
<Params>
<Criteria>
<Criterion>
<Type>Lastname</Type>
<Name>S</Name>
</Criterion>
<Criterion>
<Type>Insurance</Type>
<Name>Empire Health</Name>
</Criterion>
<Criterion>
<Type>Language</Type>
<Name>French</Name>
</Criterion>
</Criteria>
</Params>
How would I be able to submit all these values as hidden input form fields in my XSLT?
I am already sending in SessionID:
<input type="hidden" name="SessionID" value="{@SessionID}">
and a single Search Criterion:
<input type="hidden" name="{Params/Criteria/Cri
I fear I am missing the situation where multiple search criteria are within the XML and will not be returned. .. How would I iterate between all the values within the Criterion, so as to not miss sending those Criterion values in?
Any advice or guidance is greatly appreciated!
Best regards,
Jamie
ASKER
This is what I have so far:
<xsl:if test="count(Params/Criteri a/Criterio n) >0">
<xsl:for-each select="Params/Criteria/Cr iterion">
<xsl:if test="Name/text()">
<input type="hidden" value="{Params/Criteria/Cr iterion/Na me}" name="{Params/Criteria/Cri terion/Typ e}"></inpu t>
and for testing purposes (to print out what's in the XML) <xsl:value-of select="Name"></xsl:Value- of>
</xsl:if>
</xsl:for-each>
</xsl:if>
What am I doing wrong?
<xsl:if test="count(Params/Criteri
<xsl:for-each select="Params/Criteria/Cr
<xsl:if test="Name/text()">
<input type="hidden" value="{Params/Criteria/Cr
and for testing purposes (to print out what's in the XML) <xsl:value-of select="Name"></xsl:Value-
</xsl:if>
</xsl:for-each>
</xsl:if>
What am I doing wrong?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<input type="hidden" name="{Params/Criteria/Cri