Well the problem is you are trying to create a DOM object statically,
you need to do it with the context of the DOM
I created my own local$allnames to test
<@assign local$allnames <@array ROWS="2" COLS="2"
VALUE="john,doe;ralph,nader;">>
<@assign local$allnames[0,1] 'fname'>
<@assign local$allnames[0,2] 'lname'>
<@assign local$thexml <@dom '<names />'>>
<@dominsert local$thexml xpath="//names" position=append><@rows
array=local$allnames><witangostring><fname><@var local$allnames
[<@currow>,fname]></fname><lname><@var local$allnames[<@currow>,lname]
></lname></witangostring></@rows></@dominsert>
<@var local$thexml encoding=none>
the above code outputs
<names>
<witangostring>
<fname>john</fname>
<lname>doe</lname>
</witangostring>
<witangostring>
<fname>ralph</fname>
<lname>nader</lname>
</witangostring>
</names>
Ben
On Aug 11, 2006, at 5:18 AM, Dale Graham wrote:
I need to generate XML tags for an array but am running into problems.
That is, I can request a single record and by specifying (within the
tcf) out parameters for each column returned, get that in XML
E.g.,
in --> ID
out <--- Fname
out <---Lname
Webservices output
<Fname>Dan</Fname>
<Lname>Smith</Lname>
*******
But if I need a list of all the first and last names and thus
retrieve an array of "allnames", I have to create a new array to
represent each row with non-array delimited columns (I use pipes in
this example) (<@rows array=allnames><@var method$allnames
[<@currow>,fname]>|<@var method$allnames[<@currow>,lname]><@var
rdelim></@rows>) and I can then generate this:
<names>
<witangostring>Dan|Smith</witangostring>
<witangostring>John|Jones</witangostring>
</names>
While this works, we lose the clarity of the XML. In addition, I have
a request to generate XML with an array within an array (for example,
names with multiple phone numbers varying from 1 to 5), and that will
be even less clear to the recipient. So I'd like to use XML for this,
if at all possible.
If I attempt to manufacture the array with XML tags (<@rows
array=allnames><fname><@var method$allnames[<@currow>,fname]></
fname><lname><@var method$allnames[<@currow>,lname]></lname></
@rows>), I get the following webservice output
<names>
<witangostring><fname>Dan</fname><lname>Smith</
lname></witangostring>
<witangostring><fname>John</fname><lname>Jones</
lname></witangostring>
</names>
1] Is there something I am doing wrong?
2] Or if not, is there a workaround? I toyed around with different
encodings (none, html) but these did not work to resolve the problem.
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf