[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Help with creating Task child of Task

Subject: Help with creating Task child of Task
From: Charles Flanders <cflanders@xxxxxxxxxx>
Date: Wed, 31 Dec 2008 14:00:54 -0500
 Help with creating Task child of Task
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>.

My XML source:

<?xml version="1.0" encoding="UTF-8"?>
<task xml:lang="en-us" xsi:noNamespaceSchemaLocation="../../../../catalog/task.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<title>TITLE</title>
<shortdesc>SHORT DESCRIPTION</shortdesc>
<taskbody>
<prereq>
<ul>
<li>
<p>Paragraph</p>
</li>
</ul>
</prereq>
<steps>
<step>
<cmd>Click <uicontrol>Apply</uicontrol>.</cmd>
</step>
</steps>
<result>
<p>You have successfully completed this procedure.</p>
</result>
<reference-content>
<table border="1" cellpadding="2" cellspacing="0" framewidth="wide" id="table1">
<caption number="yes">TABLE TITLE</caption>
<tbody>
<tr>
<td align="left" valign="top" width="20%">
</td>
<td align="left" valign="top" width="25%"></td>
<td align="left" valign="top" width="30%"></td>
<td align="left" valign="top" width="25%"></td>
</tr>
<tr>
<td align="left" valign="top" width="20%"></td>
<td align="left" valign="top" width="25%"></td>
<td align="left" valign="top" width="30%"></td>
<td align="left" valign="top" width="25%"></td>
</tr>
</tbody>
</table>
</reference-content>
</taskbody>
</task>


Current result:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE task   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="MyID01" class="-topic/topic task/task " xml:lang="en-us">
   <title>TITLE</title>
   <shortdesc>SHORT DESCRIPTION</shortdesc>
   <taskbody>
       <prereq>
               <ul>
                   <li>
                       <p>Paragraph</p>
                   </li>
               </ul>
       </prereq>
<steps>
<step>
<cmd>Click <uicontrol>Apply</uicontrol>.</cmd>
</step>
</steps>
<result>
   <p>You have successfully completed this procedure.</p>
</result>
<task><title/><taskbody><context>
   <table id="table1" pgwide="1"><tgroup cols="4">
       <title>TABLE TITLE</title>
       <tbody>
           <row>
               <entry align="left">
               </entry>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
           </row>
           <row>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
           </row>
</tbody>
</tgroup></table>
</context></taskbody></task>
</taskbody>
</task>

DESIRED RESULT:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE task   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="MyID01" class="-topic/topic task/task " xml:lang="en-us">
   <title>TITLE</title>
   <shortdesc>SHORT DESCRIPTION</shortdesc>
   <taskbody>
       <prereq>
               <ul>
                   <li>
                       <p>Paragraph</p>
                   </li>
               </ul>
       </prereq>
<steps>
<step>
<cmd>Click <uicontrol>Apply</uicontrol>.</cmd>
</step>
</steps>
<result>
   <p>You have successfully completed this procedure.</p>
</result></taskbody>
<task><title/><taskbody><context>
   <table id="table1" pgwide="1"><tgroup cols="4">
       <title>TABLE TITLE</title>
       <tbody>
           <row>
               <entry align="left">
               </entry>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
           </row>
           <row>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
               <entry align="left"/>
           </row>
</tbody>
</tgroup></table>
</context>
</taskbody></task>
</task>


--


*Charles Flanders*

Senior Content Analyst

Vasont Content Management Solutions

717.764.9720 x302

cflanders@xxxxxxxxxx <mailto:cflanders@xxxxxxxxxx>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.