prefix is not preserved in xml

  • hi,

        This link has following https://msdn.microsoft.com/en-us/library/bb510442.aspx

    Namespace Prefixes

    Namespace prefixes are not preserved. When you specify XQuery against an xml type column, the serialized XML result may return different namespace prefixes.

    DECLARE @x xml SET @x = '<ns1:root xmlns:ns1="abc" xmlns:ns2="abc">     <ns2:SomeElement/>     </ns1:root>' SELECT @x SELECT @x.query('/*') GO

    Q1) Does that means select @x will preserve?

    yours sincerely

  • preserve what? You haven't been clear as to what you expect or think should happen.

  • Steve Jones - SSC Editor - Monday, March 13, 2017 8:52 AM

    preserve what? You haven't been clear as to what you expect or think should happen.

     artical says attribute order is not preserved( u can read), so my question is , is element order is preserved or not?

  • rajemessage 14195 - Monday, March 13, 2017 8:57 AM

    Steve Jones - SSC Editor - Monday, March 13, 2017 8:52 AM

    preserve what? You haven't been clear as to what you expect or think should happen.

     artical says attribute order is not preserved( u can read), so my question is , is element order is preserved or not?

    So is that not what you are asking here?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom A - Monday, March 13, 2017 9:18 AM

    rajemessage 14195 - Monday, March 13, 2017 8:57 AM

    Steve Jones - SSC Editor - Monday, March 13, 2017 8:52 AM

    preserve what? You haven't been clear as to what you expect or think should happen.

     artical says attribute order is not preserved( u can read), so my question is , is element order is preserved or not?

    So is that not what you are asking here?

    Microsoft's XML support is based on the 1.0 XML specification, which doesn't mandate XML as an ordered set of nodes, so no - it doesn't guarantee that the elements will be returned in document order.  Besides, your subject asked about the NAMESPACE prefix, but you now indicate being interested in something different, so yes - your question wasn't exactly clear.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 5 posts - 1 through 4 (of 4 total)

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