test data
Test =
"\[
<Table>
<Rule DayName="Sunday" Val1="1"/>
<Rule DayName="Monday" Val1="2"/>
<Rule DayName="Tuesday" Val1="3"/>
</Table>
]\";
You can get what you asked for like this:
Parse XML( Test,
On Element( "Table", Start Tag( dt1 = New Table( XML Attr( "Table" ) ) ) ),
On Element( "Rule", End Tag( New Column( XML Attr( "DayName" ), Set Values( Eval List( {XML Attr( "Val1" )} ) ) ) ) )
);
one way
But I think a better intepretation of the file might look like this:
Parse XML( Test,
On Element( "Table", Start Tag( dt2 = New Table( XML Attr( "Table" ), New Column( "DayName" ), New Column( "Val1" ) ) ) ),
On Element(
"Rule",
End Tag(
dt2 << addrow( 1 );
dt2:DayName = XML Attr( "DayName" );
dt2:Val1 = XML Attr( "Val1" );
)
)
);
Another way
(You don't want the parse(...); the example in the scripting index that uses it also has a JSL matrix in the XML file that needs the parse. Your example has a single number, in quotation marks. You could use the num() function to make the conversion so the column would be numeric. dt2:Val1 =num( XML Attr( "Val1" )); )
Craige