This example creates a Tag-List with Additional Elements

The output of this example is the following XML file:

WCCOAui1:<Spaghetti-Bolognese>
WCCOAui1: <!-- - Do you know what I think of all this!--> - @@@@ I think: <![CDATA[!@#$%@#$%!#$%!@#%#$@!@]]>
WCCOAui1: <Minced-Meat amount="800g">Half-Half Pork and Beef</Minced-Meat>
WCCOAui1: <Tomato-Concentrate amount="280g">Mix it first into the meat before heating</Tomato-Concentrate>
WCCOAui1: <Peeled-Tomatoes amount="1.6kg" type="Italian">Chop it up in smaller pieces and only add it at the end</Peeled-Tomatoes>
WCCOAui1: <Pasta-Mix-of-Spices>Make sure it contains at least 50 percent of garlic</Pasta-Mix-of-Spices>
WCCOAui1: <Dried-Oregano-Powder>This is more tasty than fresh one - Be generous with it</Dried-Oregano-Powder>
WCCOAui1: <Cutup-Shallots amount="6 big ones">Close your eyes and don't cut your fingers</Cutup-Shallots>
WCCOAui1: <Sliced-Champignons amount="12 pieces" type="...de Paris">Roast quickly into hot olive oil</Sliced-Champignons>
WCCOAui1: <Other-Ingredients pepper="chili" salt="optional" oil="Olive"/>
WCCOAui1:</Spaghetti-Bolognese>
WCCOAui1:"]

One creates first the top-element container:

root = xmlAppendChild ( document , -1 , XML_ELEMENT_NODE , "Spaghetti-Bolognese" );

The code in the example then calls only ONCE the 'fwXml_appendChildContent()' function:

fwXml_appendChildContent ( document , root , sause_content , sause_various , sause_details , exceptionInfo );

The return parameter 'exceptionInfo' indicates the user of any errors...

The dynamic string 'sause_content', 'sause_various' and 'sause_details' contain all the necessary information:

  sause_content = makeDynString (
      "",
      "",
      "",
      "",
      ... );
  
  comm[fwXml_CHILDNODESTYPE] = XML_COMMENT_NODE;
  text[fwXml_CHILDNODESTYPE] = XML_TEXT_NODE;
  data[fwXml_CHILDNODESTYPE] = XML_CDATA_SECTION_NODE;
  carr[fwXml_CHILDNODESTYPE] = XML_TEXT_NODE;

  sause_various = makeDynAnytype();
  
  dynAppend(sause_various,comm);
  dynAppend(sause_various,text);
  dynAppend(sause_various,data);
  dynAppend(sause_various,carr);
  ...
 
  sause_details = makeDynString (
      " - Do you know what I think of all this!",
      " - @@@@ I think: ",
      "!@#$%@#$%!#$%!@#%#$@!@",
      "\n ",
      ... );