Need help with xslt - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need help with xslt

@

I want these 3 values to be picked up and show in my output xml for parameters.

Example output :



m
63
728


ul
3
137


in
PASS
1526




SQ
62
728


MT
3
137


LT
FAIL
1526@


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="no" indent="yes" />
<xsl:template match="/">
<xsl:element name="File" namespace="x-schema:../Schema/QualityCertificateSchema2001Jul.xml">
<xsl:element name="Sites" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:element name="Description" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:element name="Certificates" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:for-each select="//testlot">
<xsl:variable name="LotNode" select="." />
<xsl:variable name="Lot" select="./lotnumber/value" />
<xsl:element name="Certificate" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:element name="Parameters" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:for-each select="$LotNode/aggregatedresultsdata">
<xsl:variable name="PropertyNode" select="." />
<xsl:variable name="PropertyName" select="$PropertyNode/namevalue" />
<xsl:element name="Parameter" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:element name="unit" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:value-of select="units" />
</xsl:element>
<xsl:element name="measurementValue" namespace="x-schema:../Schema/Certificateschema2001Jul.xml">
<xsl:variable name="aggdisp" select="//testlot/@
I am looking for the output like this

<?xml version="1.0" encoding="utf-8"?>
<File xmlns="x-schema:../Schema/QualityCertificateSchema2001Jul.xml">
<Sites>
<Description>
<manufacturerNumber>006173082</manufacturerNumber>
<Certificates>
<certificate="Single">
<Description>
<pName>MA</pName>
<Part>1519-8</Part>
<Order>A_A1</Order>
<lNumber>A1</lNumber>
</Description>
<Parameters>
<Parameter>
<unit>m</unit>
<measurementValue>1</measurementValue>
<code>728


ul
68
137


in
2
1526




m
1
728


ul
68
137


in
2
1526











Sign In or Register to comment.