|
Subject: Re: [xsl] Help with creating Task child of Task From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 02 Jan 2009 16:49:13 -0500 |
<xsl:template match="task">
<xsl:copy>
<xsl:copy-of select="@*"/>
<!-- going to copy the taskbody -->
<xsl:apply-templates/>
<!-- now going to make any reference-content into a new task -->
<xsl:apply-templates select="taskbody/reference-content" mode="new-task"/>
</xsl:copy>
</xsl:template><xsl:template match="reference-content"/> <!-- dropping reference-content when we see it inside the old taskbody -->
<xsl:template match="reference-content" mode="new-task">
<task>
<title/>
<taskbody>
<context>
<xsl:apply-templates/>
</context>
</taskbody>
</task>
</xsl:template>Cheers, Wendell
I'm creating an XML to XML transform. Transforming a kluged DITA model into standard DITA. I have to transform something called <reference-content> into a <task> child of the root task.
I can easily transform <reference-content> to <task>. Where I'm stuck is making the new task a sibling of the currently containing <taskbody>. Currently <reference-content> is a child of <taskbody>. Once <reference-content> is tranformed to <task>, I need to close the containing <taskbody> and make the new <task> a sibling of that <taskbody>.
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Testing for special chara, Graeme Kidd | Thread | [xsl] xml cells transformed in to a, Brendan Sleight |
| Re: [xsl] Testing for special chara, Graeme Kidd | Date | [xsl] xml cells transformed in to a, Brendan Sleight |
| Month |