SQL formatting problems with XML

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 10
Reputation: GRaymer is an unknown quantity at this point 
Solved Threads: 1
GRaymer GRaymer is offline Offline
Newbie Poster

SQL formatting problems with XML

 
0
  #1
Mar 27th, 2009
I'm running into problems with my XML format when I generate it with SQL.

I'm using SQL Server 2005. I have a query that uses FOR XML PATH that will return XML for me but it does work well with the formatting.

I'm not a XML guru but when I apply a schema to the generated XML it's not picking up the squencing and just returns as if it was curning out rows.

So:

XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <note>
  2. <to>Tove</to>
  3. <from>Jani</from>
  4. <heading>Reminder</heading>
  5. <body>Don't forget me this weekend!</body>
  6. </note>
  7.  
  8. <note>
  9. <to>Jim</to>
  10. <from>Jani</from>
  11. <heading>Reminder</heading>
  12. <body>Don't forget me this weekend!</body>
  13. </note>

What I'm looking for is something more like:
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <note>
  2. <to>Tove</to>
  3. <to>Jim</to>
  4. <from>Jani</from>
  5. <heading>Reminder</heading>
  6. <body>Don't forget me this weekend!</body>
  7. </note>

I'm not sure what to do. I've been reading up and searching google but nothing has really stood out that makes a difference.

Thanks for the help in advance.

and remember:

"Don't torture yourself, let the life to do it for you."
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC