XML comparing RAW, AUTO, EXPLICIT, and PATH

The book writes:
With the last two flavors of the FOR XML clause —the EXPLICIT and PATH options—you can manually define the XML returned.

Note: "With the last two ..."  the book has discussed RAW and AUTO up to this point.

I think the book's definition is not correct.

Question: Is my edit below correct?
Unlike with the last two flavors of the FOR XML clause (RAW and AUTO), with the EXPLICIT and PATH options, you can manually define the XML returned.
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
I'm not a native Speaker, but "the last two" sounds for me like there is an order. while there is only a functional difference between RAW/AUTO and PATH/EXPLICT. The only differ in the mechanism, how you can shape the resulting XML.

For example, even in RAW/AUTO you can do some "manually" shaping on query/sub-query level, e.g.

SELECT TOP 10
        SOH.* ,
        ( SELECT    *
          FROM      Sales.SalesOrderDetail SOD
          WHERE     SOD.SalesOrderID = SOH.SalesOrderID
        FOR
          XML AUTO,type
        ) AS Orders
FROM    Sales.SalesOrderHeader SOH
FOR     XML AUTO;

SELECT TOP 10
        SOH.* ,
        ( SELECT    *
          FROM      Sales.SalesOrderDetail SOD
          WHERE     SOD.SalesOrderID = SOH.SalesOrderID
        FOR
          XML RAW,type
        ) AS Orders
FROM    Sales.SalesOrderHeader SOH
FOR     XML RAW;

Open in new window


With PATH/EXPLICIT you can shape the XML by using a "more declarative" approach. In opposite to the query/sub-query sample, which I would consider clumsy in comparison.

So, when I would be picky about that explanation, then its more about the details.. :)

I hope you'll get my point here.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.