I have an XML structure like the following
<root>
<person>
<name>James</name>
<description xsi:type="me:age">12</description>
<description xsi:type="me:height>6 foot</description>
...
Which I have to pull out of a table like ...
Person
Name , Age , Height
I'm trying to use the FOR XML path stuff in SQL 2005 with a query like
SELECT
Name as 'name'
Age as 'description xsi:type="me:age"'
Height as 'description xsi:type="me:height"'
FOR XML PATH('person')
But it gives me an error about the 'description xsi' namespace being missing. Is there any way to achieve this using FOR XML PATH. The actual query is rather more complex than this example and would take a lot of effort to change.
Thanks