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
SSC-Enthusiastic
SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)

Group: General Forum Members
Points: 100 Visits: 195
Comments posted to this topic are about the item Stairway to XML: Level 1 - Introduction to XML
Stephen Hirsch
Stephen Hirsch
Right there with Babe
Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)Right there with Babe (768 reputation)

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

http://www.sqlservercentral.com/articles/Miscellaneous/whatisxml/2473
John Pluchino
John Pluchino
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 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 Guru
SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)

Group: General Forum Members
Points: 68955 Visits: 17545
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
SSC Journeyman
SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)SSC Journeyman (81 reputation)

Group: General Forum Members
Points: 81 Visits: 574
Hello, thanks for the article, I'm looking forward for the whole serie, seems interesting.
Phil Factor
Phil Factor
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8370 Visits: 3074
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
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2190 Visits: 633
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 (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

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

Group: General Forum Members
Points: 2190 Visits: 633
(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