xsl-list
[Top] [All Lists]

Re: [xsl] Moving (promoting) XML elements through XSL

2006-06-30 05:12:33
Never mind. I got it to work by adjusting the stylesheet as follows:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
      <xsl:output indent="yes"/>
      <xsl:template match="//topic">
              <xsl:copy>
                      <xsl:apply-templates select="@*"/>
                      <prolog>
                              <metadata>
                                      <keywords>
                                                <indexterm>
                                              <xsl:copy-of
select="title/indexterm"/>
                                                </indexterm>
                                      </keywords>
                              </metadata>
                      </prolog>
                      <xsl:apply-templates select="node()"/>
              </xsl:copy>
      </xsl:template>
      <xsl:template match="indexterm[parent::title]"/>
      <xsl:template match="@*|node()">
              <xsl:copy>
                      <xsl:apply-templates select="@*|node()"/>
              </xsl:copy>
      </xsl:template>
</xsl:stylesheet>

Thanks again for the help.

Mark


On 6/30/06, Mark Peters <flickrmeister(_at_)gmail(_dot_)com> wrote:
Great idea, drkm.  Here it is:

<?xml version="1.0"?>
<topic>
     <title>
        <indexterm>Software Requirements</indexterm>Software Requirements
     </title>
     <body>
        <p>Some sample text</p>
     </body>
</topic>

Thanks,
Mark


On 6/30/06, Florent Georges <darkman_spam(_at_)yahoo(_dot_)fr> wrote:
> Mark Peters wrote:
>
>  Hi
>
> > It looks like the script should work. I'm confounded as to
> > why it doesn't.
>
>  If you want we help you finding what's the problem, we'll need a
> sample input XML that reproduces it.
>
>  Regards,
>
> --drkm
>



--

Mark Peters
Senior Technical Writer
Saba Software

--~------------------------------------------------------------------
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>
--~--