OPEN XML - what is the diff betn Element centric and attribute centric

  • Friends,

    In OPEN XML statements . i'm not able to distinguish the diff betn Element centric and attribute centric clearly??

    Can any one throw some light on this ??

  • An element is the main tag itself such as <Element>

    An attribute is a value within the definition of an element such as <Element MyAttribute="An attribute value" />

  • here's a lame example of both to help you visualize.

    element centric:

    <ROOT>

     <BOOK>

      <TITLE>The Best of SQLServerCentral.com - Vol. 3</TITLE>

      <AUTHOR>Brian Knight</AUTHOR>

      <NUMBEROFPAGES>250</NUMBEROFPAGES>

     </BOOK>

    </ROOT>

    Attribute centric:

    <ROOT>

     <BOOK TITLE="The Best of SQLServerCentral.com - Vol. 3" AUTHOR="Brian Knight" NUMBEROFPAGES="250" />

    </ROOT>

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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