hi
I got
xml file as
<root>
<Question>
<QuestionName>A</QuestionName>
<QuestionNumber>123</QuestionNumber>
</Question>
<Question>
<QuestionName>AA</QuestionName>
<QuestionNumber>123123</QuestionNumber>
</Question>
<Rule>
<RuleName>B</RuleName>
<RuleNumber>456</RuleNumber>
<RuleName>BB</RuleName>
<RuleNumber>456456</RuleNumber>
</Rule>
</root>
then i have xsl file as
<xsl:template match="/">
<Product>
<xsl:apply-templates/>
</Product>
</xsl:template>
<xsl:template match="Question">
<xsl:element name="Question">
<QID>
<xsl:apply-templates select="QuestionName"/>
</QID>
<QNo>
<xsl:apply-templates select="QuestionNumber"/>
</QNo>
</xsl:element>
</xsl:template>
<xsl:template match="Rule">
<xsl:element name="Rule">
<RID>
<xsl:apply-templates select="RuleName"/>
</RID>
<RNo>
<xsl:apply-templates select="RuleNumber"/>
</RNo>
</xsl:element>
</xsl:template>
it gave me result as below:
<Product>
<Question>
<QID>A</QID>
<QNo>123</QNo>
</Question>
<Question>
<QID>AA</QID>
<QNo>123123</QNo>
</Question>
<Rule>
<RID>B</RID>
<RNo>456</RNo>
</Rule>
<Rule>
<RID>BB</RID>
<RNo>456456</RNo>
</Rule>
</Product>
But I would like it turn out like below: (extra QuestionDataset and
RuleDataset tag)
<Product>
<QuestionDataset>
<Question>
<QID>A</QID>
<QNo>123</QNo>
</Question>
<Question>
<QID>AA</QID>
<QNo>123123</QNo>
</Question>
</QuestionDataset>
<RuleDataset>
<Rule>
<RID>B</RID>
<RNo>456</RNo>
</Rule>
<Rule>
<RID>BB</RID>
<RNo>456456</RNo>
</Rule>
</RuleDataset>
</Product>
What i should do on XSLT file??
Thanks
Oleg Tkachenko [MVP] - 26 Oct 2004 11:46 GMT
> But I would like it turn out like below: (extra QuestionDataset and
> RuleDataset tag)
<xsl:template match="/">
<Product>
<QuestionDataset>
<xsl:apply-templates select="root/Question"/>
</QuestionDataset>
<RuleDataset>
<xsl:apply-templates select="root/Rule"/>
</RuleDataset>
</Product>
</xsl:template>

Signature
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com