I am trying to create an xml output in SQL 2008 using FOR XML Path. This is working fine:
Clothing
I know this is an old post, but I want to share one solution that avoids that FOR XML EXPLICIT command complexity for big xmls.
It's enough to add null as a child of Taxonomy, and error will disappear:
select 1 as 'Taxonomy/Category/@Level',
t.MainCat as 'Taxonomy/Category',
NULL AS 'Taxonomy/*',
2 as 'Taxonomy/Category/@Level',
t.SubCat as 'Taxonomy/Category',
from t
I hope it helps.