SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stairway to XML: Level 1 - Introduction to XML


Stairway to XML: Level 1 - Introduction to XML

Author
Message
rhsheldon
rhsheldon
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 195
Comments posted to this topic are about the item Stairway to XML: Level 1 - Introduction to XML
Stephen Hirsch
Stephen Hirsch
Mr or Mrs. 500
Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)

Group: General Forum Members
Points: 518 Visits: 161
XML isn't a language, it's a meta-language:

http://www.sqlservercentral.com/articles/Miscellaneous/whatisxml/2473
John Pluchino
John Pluchino
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 60
<?xml version="1.0" encoding="UTF-8"?>
<!-- My Comments -->
<Assessment> " Excellent Job! "</Assessment>
dwat22
dwat22
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 42
This was a fantastic article. Very well laid out and easy to understand. Thanks!
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35874 Visits: 16699
Thanks for the beginner's guide, Rob - very much needed in my case! I have one question on this. Are elements and attributes functionally equivalent? For example, does this:
<People>
<Person id="1234">
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Person>
<Person id="5678">
<FirstName>Jane</FirstName>
<LastName>Doe</LastName>
</Person>
</People>


do the same as this?
<People>
<Person>
<id>1234</id>

<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Person>
<Person>
<id>5678</id>

<FirstName>Jane</FirstName>
<LastName>Doe</LastName>
</Person>
</People>



Thanks
John

Edit: changed closing tags for id so they had a "/" in.
DanOrc
DanOrc
Valued Member
Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)Valued Member (53 reputation)

Group: General Forum Members
Points: 53 Visits: 570
Hello, thanks for the article, I'm looking forward for the whole serie, seems interesting.
Phil Factor
Phil Factor
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4964 Visits: 3031
Thanks for that, Robert.
However much I read up about XML, I always gain from reading more, and I always find some gems in your writing on XML
From a fan.


Best wishes,

Phil Factor
Simple Talk
SQLBalls
SQLBalls
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1298 Visits: 630
Very Nice Article, a great introduction to covering the concept and touching all the bases!

Twitter: @SQLBalls
Blog: http://www.SQLBalls.com
BobMcClellan
BobMcClellan
SSC-Enthusiastic
SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)SSC-Enthusiastic (148 reputation)

Group: General Forum Members
Points: 148 Visits: 129
Great Article.
I am also interested in John Mitchel's question...
"Are elements and attributes functionally equivalent? "
tia,
Bob
SQLBalls
SQLBalls
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1298 Visits: 630
(my XML is rusty and I need to brush up, so excuse the lack of detail in the reply).

At this level it appears that way, but when you get into how to parse and read an XML file then you get the data in a slightly seperate way from an Attribute vs an Element.


For us SQL folk if you look at the XML of an execution plan, and start getting into X query you'll see that we have to parse a little differently for each.

In an XML document you can set up XML Indexes in SQL. There are only two types Primary XML Indexes and Secondary (both require a Clustered Index on the base table).

As an element you wouldn't be able to build an XML index on the ID column, as an attribute you could. There's probably a lot of "It depends" in here as well, again I'm rusty and we probably have some other folks that could explain this a little better.

Twitter: @SQLBalls
Blog: http://www.SQLBalls.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search