Home Forums Programming XML LOADING COMPLEX XML FILE RE: LOADING COMPLEX XML FILE

  • Hi. That snippit of xml that you have pasted seems to be a little different to your original xml that you posted earlier on.

    Try this updated version of the query based on your new example xml format:

    ;with xmlnamespaces ('urn:com.workday/bsvc' as d1p1)

    SELECT @xml.query('

    <Workers>

    {

    for $x in //d1p1:Worker

    return

    <Worker>

    <EmployeeID>{$x/d1p1:Worker_Reference/d1p1:ID[@d1p1:type="Contingent_Worker_ID"]/text()}</EmployeeID>

    <FullName>{data($x/d1p1:Worker_Reference/@d1p1:Descriptor)}</FullName>

    </Worker>

    }

    </Workers>

    ')