Hi,
I am trying to figure out how to see if any of a given set of childnodes equals a given string. For example, in the XML and XSL code below, I want the text in the "xsl:when" statement to output when any of the childnodes of <FormulaValue > equal the string "Value". How can I do this?? I am trying to use XPath code but I can't get it to work.
Thank you!!
Christine
XSL code:
XML code:
I am trying to figure out how to see if any of a given set of childnodes equals a given string. For example, in the XML and XSL code below, I want the text in the "xsl:when" statement to output when any of the childnodes of <FormulaValue > equal the string "Value". How can I do this?? I am trying to use XPath code but I can't get it to work.
Thank you!!
Christine
XSL code:
Code:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:for-each select="RecipeElement/Steps/Step/FormulaValue"> <xsl:choose> <xsl:when test="name(child::node()[3])=Value"> <d>Value is present</d> </xsl:when> </xsl:choose> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
Code:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="stylesheet13.xsl"?> <RecipeElement> <RecipeElementID>UFDF_CLEANING</RecipeElementID> <Steps> <InitialStep XPos="700" YPos="100"> <Name>INITIALSTEP:1</Name> </InitialStep> <TerminalStep XPos="800" YPos="1098"> <Name>TERMINALSTEP:1</Name> </TerminalStep> <Step XPos="600" YPos="598" AcquireUnit="true"> <Name>UFDF_CLEANING:1</Name> <StepRecipeID>UFDF_CLEANING</StepRecipeID> <UnitAlias>UFDF_CLEANING:1</UnitAlias> <FormulaValue> <Name>PUMP_SPEED</Name> <Display>false</Display> <Value /> <Real>5</Real> <EngineeringUnits /> </FormulaValue> </Step> </Steps> </RecipeElement>
Comment