Jack Seaman
asked on
How do I alter the output where the attributes are elements in this MS SQL statement
Here is the statement I am using to generate the XML. However it need to have attributes that are elements/
select id, Rtrim(title)as title1, author, datecreated, Rtrim(body) as body1, image1,
REPLACE(RTRIM(SUBSTRING(Ti tle, 1, 25)), ' ', '-') AS pagename
from ecsuheadlines
FOR XML AUTO
Current output:
<ecsuheadlines id="428" title1="Faculty make headlines" author="Kesha Williams" datecreated="2005-01-03T00 :00:00" body1="ECSU announces the following briefs of achievements by its faculty and staff: <p>

&# xA; 

Dr. Carolyn R. Mahoney, ECSU Provost and Vice Chancellor for Academic Affairs, was a co-author on the National Research Council Report "On Evaluating Curricular Effectiveness: Judging the Quality of K-12 Mathematics Evaluations," Washington, DC, at the National Academies Press in May 2004. <p>

&# xA;Dr. Carolyn Mahoney, ECSU Provost and Vice Chancellor of Academic Affairs, was an invited plenary speaker at the Education Trust annual national conference on closing the achievement gap. Her talk, entitled "Access, Retention and Completion: The ECSU Story" was delivered to national educators, community leaders and policy makers in Washington, DC in November
Preferred output
<headlines>
<headline>
<id>428</id>
<title1> Faculty make headlines </title1>
<author> Kesha Williams </author>
<datecreated>2005-01-03T00 :00:00</da tecreated>
<body1>ECSU announces the following briefs of achievements by its faculty and staff: <p>

&# xA; 

Dr. Carolyn R. Mahoney, ECSU Provost and Vice Chancellor for Academic Affairs, was a co-author on the National Research Council Report "On Evaluating Curricular Effectiveness: Judging the Quality of K-12 Mathematics Evaluations," Washington, DC, at the National Academies Press in May 2004. <p>

&# xA;Dr. Carolyn Mahoney, ECSU Provost and Vice Chancellor of Academic Affairs, was an invited plenary speaker at the Education Trust annual national conference on closing the achievement gap. Her talk, entitled "Access, Retention and Completion: The ECSU Story" was delivered to national educators, community leaders and policy makers in Washington, DC in November
select id, Rtrim(title)as title1, author, datecreated, Rtrim(body) as body1, image1,
REPLACE(RTRIM(SUBSTRING(Ti
from ecsuheadlines
FOR XML AUTO
Current output:
<ecsuheadlines id="428" title1="Faculty make headlines" author="Kesha Williams" datecreated="2005-01-03T00
Preferred output
<headlines>
<headline>
<id>428</id>
<title1> Faculty make headlines </title1>
<author> Kesha Williams </author>
<datecreated>2005-01-03T00
<body1>ECSU announces the following briefs of achievements by its faculty and staff: <p>

&#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for wjseaman's comment #a40946175
for the following reason:
It worked.
Accepted answer: 0 points for wjseaman's comment #a40946175
for the following reason:
It worked.
If my solution worked, why is this being closed with zero points?
ASKER
Where do I award points?
Not that I didn't want too....
Not that I didn't want too....
ASKER