xsl-list
[Top] [All Lists]

Re: [xsl] Add an element that contains multiple nested elements

2006-05-16 08:50:32
This is the result I need to achieve:

<rootElement>
 <container>
  <element1>
    <elementA>A</elementA>
  </element1>
...
  <element2>
    <elementB>B</elementB>
  </element1>
 </container>
</rootElement>

Ummm, so

<xsl:template match="rootElement">
<container>
<xsl:apply-templates />
</container>
</xsl:template>

?

Typically I'd try to explain what's happening instead of just
responding to code, but I'm not entirely sure what you did to get your
mistaken output.

Probably something like:
<xsl:template match="rootElement/*">
<container>
<xsl:apply-templates />
</container>
</xsl:template>

If you did, then you need some review on the basics of XPath.
Otherwise you might be abusing for-each.  But this really is a simple
problem.

Jon Gorman.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--