>I'd include a bit of error checking for those XMLLists...
> 
> for each (var contentRowItem:XML in _contentXML..row)
> {
>    var moduleName:String = contentRowItem.Module;
>    var topicXML:XML = new XML("<topic />");
>    topicx...@title = contentRowItem.LinkTitle;
>    var modulesList:XMLList=finalXML.module.(@title == moduleName);
>    if (modulesList.length()!=1)
>      throw new Error("Can't find single module with title:"+moduleName);
> 
>    var topicsList:XMLList=
> modulesList[0]..subsection.(@title==contentRowItem.Subsection).topics;
>    if (topicsList.length()!=1)
>      throw new Error("Can't find single subsection with
> title:"+contentRowItem.Subsection);
> 
>    topicsList[0].appendChild(topicXML);
> }

Thanks Ian, that gets me closer, but it doesn't quite work because, I get the 
error, "Can't find single subsection with title:Assumptions" - because not 
every subsection will have one with that title - that topic is only in certain 
subtopics.  The XML it needs to be inserted into looks like this:

<xml>
  <modules>
    <module title="iRequire" orderID="0">
      <subsections>
        <subsection title="Technical Constraints"/>
        <subsection title="Project Information"/>
      </subsections>
    </module>
    <module title="iDesign" orderID="1.00000000000000">
      <subsections>
        <subsection title="Assumptions"/>
      </subsections>
    </module>
    <module title="iBuild" orderID="2.00000000000000">
      <subsections>
        <subsection title="Assumptions"/>
        ...etc.

So there are some subsections that have one with a title of "Assumtions", but 
you'll see the first module's subsections doesn't have one.  Trying to figure 
out how to account for that withouth getting null property errors.  Any ideas?

Thanks, you've given me some good stuff to work with so far!

Jason


Reply via email to