Link to home
Start Free TrialLog in
Avatar of jmc430
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/Criterion/Type}" value="{Params/Criteria/Criterion/Type}">

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
Avatar of jmc430
jmc430

ASKER

Slight correction, the single search criterion i am sending is:

<input type="hidden" name="{Params/Criteria/Criterion/Type}" value="{Params/Criteria/Criterion/Name}">
Avatar of jmc430

ASKER

This is what I have so far:

<xsl:if test="count(Params/Criteria/Criterion) >0">
<xsl:for-each select="Params/Criteria/Criterion">
<xsl:if test="Name/text()">

<input type="hidden" value="{Params/Criteria/Criterion/Name}" name="{Params/Criteria/Criterion/Type}"></input>

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?

SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial