XML namespace

  • hi

    help needed in regard to xml namespace

    while I'm able to make the following work

    With XMLNAMESPACES ('http://www.test.namespace.com/ns/1.0' as c)

    Select 'value' [c:test] For xml path(''),Elements, type

    I have a problem with the following

    Declare @x xml;

    With XMLNAMESPACES ('http://www.test.namespace.com/ns/1.0' as c)

    SET @x = Select 'value' [c:test] For xml path(''),Elements, type

    Select @x

    Thanks

    Pavan

  • I think something like this should work.....

    Declare @x xml;

    With XMLNAMESPACES ('http://www.test.namespace.com/ns/1.0' as c)

    SELECT @x = 'value' [c:test] For xml path(''),Elements, type

    Select @x



    Ade

    A Freudian Slip is when you say one thing and mean your mother.
    For detail-enriched answers, ask detail-enriched questions...[/url]

  • This works:

    Declare @x xml;

    With XMLNAMESPACES ('http://www.test.namespace.com/ns/1.0' as c)

    SELECT @x = (SELECT 'value' [c:test] For xml path(''),Elements, type)

    Select @x

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply