This example creates a Tag-List with Attributes and Data

The output of this example is the following XML file:

WCCOAui1:["Xml-Document = ...
WCCOAui1:<Spaghetti-Bolognese>
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 (
      "Minced-Meat",
      "Tomato-Concentrate",
      "Peeled-Tomatoes",
      "Pasta-Mix-of-Spices",
      "Dried-Oregano-Powder",
      "Cutup-Shallots",
      "Sliced-Champignons",
      "Other-Ingredients" );
	  
  meat["amount"] = "800g";
  conc["amount"] = "280g";
  toma["amount"] = "1.6kg";
  toma["type"]   = "Italian";
  shal["amount"] = "6 big ones";
  cham["amount"] = "12 pieces";
  cham["type"]   = "...de Paris";
  ingr["oil"]    = "Olive";
  ingr["pepper"] = "chili";
  ingr["salt"]   = "optional";

  sause_various = makeDynAnytype();
  
  dynAppend(sause_various,meat);
  dynAppend(sause_various,conc);
  dynAppend(sause_various,toma);
  dynAppend(sause_various,null);
  dynAppend(sause_various,null);
  dynAppend(sause_various,shal);
  dynAppend(sause_various,cham);
  dynAppend(sause_various,ingr);
  
  sause_details = makeDynString (
      "Half-Half Pork and Beef",
      "Mix it first into the meat before heating",
      "Chop it up in smaller pieces and only add it at the end",
      "Make sure it contains at least 50 percent of garlic",
      "This is more tasty than fresh one - Be generous with it",
      "Close your eyes and don't cut your fingers",
      "Roast quickly into hot olive oil",
      "" );