On Wed, May 5, 2010 at 9:33 AM, Devon McCormick <[email protected]> wrote:
...
>   rawdata=: 2 3 $ 'Vilma';'Shenzen';'China';'Alex';'Makati';'Philippines'
>   dummies=. '{name}';'{city}';'{country}'
>   body=. ;(<xmlUser) rplc&.>  <"1 ,"2 dummies,."(_ 1)rawdata
>
>   xmlHdr,body,xmlTail

I would be tempted to rephrase that.

Perhaps:

xmlDoc=: '{user}';0 :0
<?xml version="1.0"?>
<data>
{user}
</data>
)

xmlUser=: '{name} {city} {country}';0 :0
 <user>
  <name>{name}</name>
  <city>{city}</city>
  <country>{country}</country>
 </user>
)

tmpl=:1 :0
  'names template'=. m
  [:;[:template&rplc&.> (cutnames_j_ names) <@,."1 boxopen
)

   xmlDoc tmpl xmlUser tmpl rawdata

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to