Hi,
I am trying to create an XSL file that can be applied to numerous XML files (all XML files have similar structure but varying length). The XSL and abbreviated XML codes are below. Within the XSL I need to create some sort of conditional statements that will produce a number of columns equal to the number of <FormulaValue > subsets in the XML code (this number will need to change depending on the XML). I also need to name each column the appropriate <Name> corresponding to the respective <FormulaValue > which I cannot figure out how to do. Please help me!!
Thank you,
Christine
current XSL code:
[code=xml]<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:d="urn:Ro ckwell/MasterRecipe"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<table border="2">
<tr bgcolor="99%,99 %,99%">
<th width="50"></th><th width="250">Ste ps</th>
<th width="250">fro m xml</th>
</tr>
<tr>
<td></td><td>Cell B</td><td>Cell C</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>[/code]
XML code:
[code=xml]<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="G93952_X7 835_UFDF_Cleani ng.xsl"?>
<RecipeElemen t xmlns="urn:Rock well/MasterRecipe" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" SchemaVersion=" 3519">
<RecipeElementI D>G93952_X7835_ UFDF_CLEANING</RecipeElementID >
<Steps>
<InitialStep XPos="700" YPos="100">
<Name>INITIALST EP:1</Name>
</InitialStep>
<TerminalStep XPos="800" YPos="1098">
<Name>TERMINALS TEP:1</Name>
</TerminalStep>
<Step XPos="600" YPos="598" AcquireUnit="tr ue">
<Name>UP_X783X_ UFDF_CLEANING:1 </Name>
<StepRecipeID>U P_X783X_UFDF_CL EANING</StepRecipeID>
<UnitAlias>UP_X 783X_UFDF_CLEAN ING:1</UnitAlias>
<FormulaValue >
<Name>CIP_FEED_ PUMP_SPEED</Name>
<Display>fals e</Display>
<Value/>
<Real>75</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
<FormulaValue >
<Name>CIP_XFER_ PUMP_SPEED</Name>
<Display>fals e</Display>
<Value/>
<Real>35</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
<FormulaValue >
<Name>FEED_FLOW _RATE</Name>
<Display>fals e</Display>
<Value/>
<Real>5.7</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
</Step>
</Steps>
</RecipeElement>[/code]
I am trying to create an XSL file that can be applied to numerous XML files (all XML files have similar structure but varying length). The XSL and abbreviated XML codes are below. Within the XSL I need to create some sort of conditional statements that will produce a number of columns equal to the number of <FormulaValue > subsets in the XML code (this number will need to change depending on the XML). I also need to name each column the appropriate <Name> corresponding to the respective <FormulaValue > which I cannot figure out how to do. Please help me!!
Thank you,
Christine
current XSL code:
[code=xml]<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:d="urn:Ro ckwell/MasterRecipe"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<table border="2">
<tr bgcolor="99%,99 %,99%">
<th width="50"></th><th width="250">Ste ps</th>
<th width="250">fro m xml</th>
</tr>
<tr>
<td></td><td>Cell B</td><td>Cell C</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>[/code]
XML code:
[code=xml]<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="G93952_X7 835_UFDF_Cleani ng.xsl"?>
<RecipeElemen t xmlns="urn:Rock well/MasterRecipe" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" SchemaVersion=" 3519">
<RecipeElementI D>G93952_X7835_ UFDF_CLEANING</RecipeElementID >
<Steps>
<InitialStep XPos="700" YPos="100">
<Name>INITIALST EP:1</Name>
</InitialStep>
<TerminalStep XPos="800" YPos="1098">
<Name>TERMINALS TEP:1</Name>
</TerminalStep>
<Step XPos="600" YPos="598" AcquireUnit="tr ue">
<Name>UP_X783X_ UFDF_CLEANING:1 </Name>
<StepRecipeID>U P_X783X_UFDF_CL EANING</StepRecipeID>
<UnitAlias>UP_X 783X_UFDF_CLEAN ING:1</UnitAlias>
<FormulaValue >
<Name>CIP_FEED_ PUMP_SPEED</Name>
<Display>fals e</Display>
<Value/>
<Real>75</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
<FormulaValue >
<Name>CIP_XFER_ PUMP_SPEED</Name>
<Display>fals e</Display>
<Value/>
<Real>35</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
<FormulaValue >
<Name>FEED_FLOW _RATE</Name>
<Display>fals e</Display>
<Value/>
<Real>5.7</Real>
<EngineeringUni ts></EngineeringUnit s>
</FormulaValue>
</Step>
</Steps>
</RecipeElement>[/code]
Comment