Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL EXPLICIT problem

Author  Topic 

senthilk@peppersquare.com
Starting Member

3 Posts

Posted - 2008-11-21 : 03:57:35
Hi,

I have an issue in SQL EXPLICIT query, please advice me to fix this.

My Table Name is ContactUnsubscribe1

-------------------------
CREATE TABLE [dbo].[ContactUnsubscribe1] (
[Contactunsubscribe] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[RequestedDate] [datetime] NULL ,
[EmailID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InvitationforWiproevents] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InvitationforWiproWebinars] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WiproNewsFlashes] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WiproPeerPing] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SurveyResearch] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InfoOnNewServices] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InfoOnOffersBU] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[status] [bit] NULL ,
[UID] [int] IDENTITY (1, 1) NOT NULL ,
[Solicit] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

-------------------------

I want the output as XML in the format given below:

<Contactunsubscribe>
<contact>
<Email>test@yahoo.com</Email>
<RequestedDate>09/23/2008</RequestedDate>
<category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>test1@yahoo.com</Email>
<RequestedDate>09/23/2008</RequestedDate>
<category>
<Solicit>Unsubscribe</Solicit>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
----------------------------------------------------------

So, i used XML Explicit..... i used the below query...


SELECT Tag, Parent,
[Contactunsubscribe!1!],
[Contact!2!Email!Element],
[Contact!2!RequestedDate!Element],
[Category!3!Element],
[Category!3!InvitationforWiproevents!Element],
[Category!3!InvitationforWiproWebinars!Element],
[Category!3!WiproNewsFlashes!Element],
[Category!3!WiproPeerPing!Element],
[Category!3!SurveyResearch!Element],
[Category!3!InfoOnNewServices!Element],
[Category!3!InfoOnOffersBU!Element]
FROM (
SELECT
1 AS Tag,
NULL AS Parent,
NULL AS 'Contactunsubscribe!1!',
NULL AS 'Contact!2!Email!Element',
NULL AS 'Contact!2!RequestedDate!Element',
NULL AS 'Category!3!Element',
NULL AS 'Category!3!InvitationforWiproevents!Element',
NULL AS 'Category!3!InvitationforWiproWebinars!Element',
NULL AS 'Category!3!WiproNewsFlashes!Element',
NULL AS 'Category!3!WiproPeerPing!Element',
NULL AS 'Category!3!SurveyResearch!Element',
NULL AS 'Category!3!InfoOnNewServices!Element',
NULL AS 'Category!3!InfoOnOffersBU!Element'
UNION ALL
SELECT
2 AS Tag, 1 AS Parent,
NULL, EmailID, RequestedDate, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
FROM Contactunsubscribe1
UNION ALL
SELECT
3 AS Tag, 2 AS Parent,
NULL, NULL, NULL, NULL, InvitationforWiproevents, InvitationforWiproWebinars, WiproNewsFlashes, WiproPeerPing, SurveyResearch, InfoOnNewServices, InfoOnOffersBU
FROM Contactunsubscribe1
) A
FOR XML EXPLICIT

I used this query, but the output is little different.. I want the output in exact format i specified top.

Anybody, Please help to fix this...it's urgent...

Thanks in Advance.
senthil

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2008-11-24 : 07:06:42
SELECT Tag, Parent,
[Contactunsubscribe!1!],
[Contact!2!Email!Element],
[Contact!2!RequestedDate!Element],
[Category!3!Element],
[Category!3!Solicit!Element],
[Category!3!InvitationforWiproevents!Element],
[Category!3!InvitationforWiproWebinars!Element],
[Category!3!WiproNewsFlashes!Element],
[Category!3!WiproPeerPing!Element],
[Category!3!SurveyResearch!Element],
[Category!3!InfoOnNewServices!Element],
[Category!3!InfoOnOffersBU!Element]
FROM (
SELECT
1 AS Tag,
NULL AS Parent,
NULL AS 'Contactunsubscribe!1!',
NULL AS 'Contact!2!Email!Element',
NULL AS 'Contact!2!RequestedDate!Element',
NULL AS 'Category!3!Element',
NULL AS 'Category!3!InvitationforWiproevents!Element',
NULL AS 'Category!3!InvitationforWiproWebinars!Element',
NULL AS 'Category!3!WiproNewsFlashes!Element',
NULL AS 'Category!3!WiproPeerPing!Element',
NULL AS 'Category!3!SurveyResearch!Element',
NULL AS 'Category!3!InfoOnNewServices!Element',
NULL AS 'Category!3!InfoOnOffersBU!Element',
NULL AS 'Category!3!Solicit!Element',
0 as c1
UNION ALL
SELECT
2 AS Tag, 1 AS Parent,
NULL, EmailID, RequestedDate, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, UIDFROM #ContactUnsubscribe1
UNION ALL
SELECT
3 AS Tag, 2 AS Parent,
NULL, NULL, NULL, NULL, InvitationforWiproevents, InvitationforWiproWebinars, WiproNewsFlashes, WiproPeerPing, SurveyResearch, InfoOnNewServices, InfoOnOffersBU, [Solicit]
, UID
FROM #ContactUnsubscribe1
) A order by c1, parentFOR XML EXPLICIT

--------------------------------------------------
S.Ahamed
Go to Top of Page

senthilk@peppersquare.com
Starting Member

3 Posts

Posted - 2008-11-24 : 08:53:43
Hi Ahmed,

I tried your code.. Again same thing i got,,,, please advice me....ya..

With your query i added XMLDATA in the end of the query, because i run this query through my .net application..

While running your code ... i got the output as

<?xml version="1.0" standalone="yes"?>
<Schema1>
<Contactunsubscribe />
<Contact>
<Email>ss@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@se.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>se@ps.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@ds.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>rs@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
</Schema1>

Before you given the code, the output is look like same what i m now got...

--------------------------------------------------
I want the output as exactly in the below ....

<Contactunsubscribe>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/23/2008</RequestedDate>
<category>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Unsubscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@gmail.com</Email>
<RequestedDate>10/23/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/22/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/22/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Unsubscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@yahoo.com</Email>
<RequestedDate>10/30/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@ss.com</Email>
<RequestedDate>11/18/2008</RequestedDate>
<category>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
</Contactunsubscribe>


Please advice me ......

Thanks for your valuable time......

Senthil
Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2008-11-24 : 22:42:52
I got the same out put what u wanted.... Here based on the order other than Tag and Parent, the SQL server produces the xml (concentrate on the order). I used the below code and gives the desired output.

CREATE TABLE #ContactUnsubscribe1 (
[Contactunsubscribe] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[RequestedDate] [datetime] NULL ,
[EmailID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InvitationforWiproevents] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InvitationforWiproWebinars] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WiproNewsFlashes] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[WiproPeerPing] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SurveyResearch] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InfoOnNewServices] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[InfoOnOffersBU] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[status] [bit] NULL ,
[UID] [int] IDENTITY (1, 1) NOT NULL ,
[Solicit] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

insert into #ContactUnsubscribe1
values
(
'level1',
getdate(),
'2@abc.com',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
1,
'level13')

insert into #ContactUnsubscribe1
values
(
'2level1',
getdate(),
'22@abc.com',
'2level4',
'2level5',
'2level6',
'2level7',
'2level8',
'2level9',
'2level10',
2,
'2level13')

insert into #ContactUnsubscribe1
values
(
'ertwet',
getdate(),
'eet@rtd.com',
'fdh',
'bvm',
'xb',
'vcn',
'vbn',
'xcb',
'xb',
2,
'xcb')

SELECT Tag, Parent,
[Contactunsubscribe!1!],
[Contact!2!Email!Element],
[Contact!2!RequestedDate!Element],
[Category!3!Element],
[Category!3!Solicit!Element],
[Category!3!InvitationforWiproevents!Element],
[Category!3!InvitationforWiproWebinars!Element],
[Category!3!WiproNewsFlashes!Element],
[Category!3!WiproPeerPing!Element],
[Category!3!SurveyResearch!Element],
[Category!3!InfoOnNewServices!Element],
[Category!3!InfoOnOffersBU!Element]
FROM (
SELECT
1 AS Tag,
NULL AS Parent,
NULL AS 'Contactunsubscribe!1!',
NULL AS 'Contact!2!Email!Element',
NULL AS 'Contact!2!RequestedDate!Element',
NULL AS 'Category!3!Element',
NULL AS 'Category!3!InvitationforWiproevents!Element',
NULL AS 'Category!3!InvitationforWiproWebinars!Element',
NULL AS 'Category!3!WiproNewsFlashes!Element',
NULL AS 'Category!3!WiproPeerPing!Element',
NULL AS 'Category!3!SurveyResearch!Element',
NULL AS 'Category!3!InfoOnNewServices!Element',
NULL AS 'Category!3!InfoOnOffersBU!Element',
NULL AS 'Category!3!Solicit!Element',
0 as c1
UNION ALL
SELECT
2 AS Tag, 1 AS Parent,
NULL, EmailID, RequestedDate, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, UID
FROM #ContactUnsubscribe1
UNION ALL
SELECT
3 AS Tag, 2 AS Parent,
NULL, NULL, NULL, NULL, InvitationforWiproevents, InvitationforWiproWebinars, WiproNewsFlashes, WiproPeerPing, SurveyResearch, InfoOnNewServices, InfoOnOffersBU, [Solicit]
, UID
FROM #ContactUnsubscribe1
) A order by c1, parent
FOR XML EXPLICIT




--------------------------------------------------
S.Ahamed
Go to Top of Page

senthilk@peppersquare.com
Starting Member

3 Posts

Posted - 2008-11-25 : 01:45:14
Hi Ahmed,

Thanks.

As you given, I checked, the above query throws the perfect output while using query analyser in sql server 2000.

How i get this output as XML format. Can you advice me..

I tried using .net application, it throws output in different format that is my problem...

I have used XMLDATA with that query to make xml output..
my output comes as ....

<?xml version="1.0" standalone="yes"?>
<Schema1>
<Contactunsubscribe />
<Contact>
<Email>ss@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@se.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>se@ps.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@ds.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>rs@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Contact>
<Email>ss@ss.com</Email>
<RequestedDate>2008-10-18T00:00:00+05:30</RequestedDate>
</Contact>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
<Category>
<Solicit>Subscribe</Solicit>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</Category>
</Schema1>

But i want the output XML as.....
<Contactunsubscribe>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/23/2008</RequestedDate>
<category>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Unsubscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@gmail.com</Email>
<RequestedDate>10/23/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Subscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Subscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/22/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Subscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@peppersquare.com</Email>
<RequestedDate>10/22/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Unsubscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@yahoo.com</Email>
<RequestedDate>10/30/2008</RequestedDate>
<category>
<InvitationforWiproevents>Subscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Subscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Unsubscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
<contact>
<Email>ss@ss.com</Email>
<RequestedDate>11/18/2008</RequestedDate>
<category>
<InvitationforWiproevents>Unsubscribe</InvitationforWiproevents>
<InvitationforWiproWebinars>Unsubscribe</InvitationforWiproWebinars>
<WiproNewsFlashes>Unsubscribe</WiproNewsFlashes>
<WiproPeerPing>Subscribe</WiproPeerPing>
<SurveyResearch>Unsubscribe</SurveyResearch>
<InfoOnNewServices>Subscribe</InfoOnNewServices>
<InfoOnOffersBU>Unsubscribe</InfoOnOffersBU>
</category>
</contact>
</Contactunsubscribe>


Sorry for keep asking questions....

Please advice me , to get the exact output in xml format. So, that i can move for further work.. I m still stuck in this part...please...

Thanks Again,
Senthil





Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2008-11-25 : 02:47:10
I am having little knowledge of .net. Get the content from the SQL server and create xml file out of it juz putting the content
using XML Document class and load xml.

--------------------------------------------------
S.Ahamed
Go to Top of Page
   

- Advertisement -