Author: MattMatt Date: Jan 25, 2007 05:51
Mark,
Thanks that definitly gets me going in the right direction. Can you explain
the statement count($a/../*[. << $a]) , other than count() I get lost after
the "[".
Thanks,
Matt
hotmail.com> wrote in message
news:1169684064.504759.156860@q2g2000cwa.googlegroups.com...
> Maybe this?
>
>
> select Data.Student.value('@id', 'varchar(6)') as id,
> Data.Student.value('(Name)[1]', 'varchar(30)') as [name],
> Data.Student.value('(Class)[1]', 'varchar(50)') as class ,
> Data.Student.value('for $a in . return count($a/../*[. << $a]) +
> 1','int') as ndx
> from @xmlvar.nodes('/Data/Student') Data(Student)
>
|