|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FOR XML AUTO, ELEMENTS Problemplain text. I am doing a query against that column and converting the results to XML as follows: Select ProblemResolution From Incident Where RowID = 2 FOR XML AUTO, ELEMENTS The problem is the XML that is being generated. It appears the XML that is generated is illegal (in some cases) because if I save the resulting XML in a text file and load into Internet Explorer, IE generates errors. Here is the plain text (actually part of it - enough to demo the problem) as stored in the column. The quotes are not stored. "8/11/2006 dabonder - Carol - Thanks for the detail. I looked at the 6060 transaction and it was as you thought - these accounts are not set up in the .| If the corresponding project account to 6060 would never be used in a time sheet or expense report then you would not need to have a. I haven't had time to clarify this. If you want to discuss when you get time I would be happy to. -D Abonder D Abonder Director of Consulting Some Company www.SomeCompany.com Email: dgon***@somecompany.com Phone: 123-555-3450" Here is the generated (illegal) XML: <Incident><ProblemResolution>8/11/2006 dabonder -
 
 Carol -
 
 Thanks for the detail. I looked at the 6060 transaction and it was as you thought - these accounts are not set up in the .
 
 If the corresponding project account to 6060 would never be used in a time sheet or expense report then you would not need to have a.
 
 I haven't had time to clarify this. If you want to discuss when you get time I would be happy to.
 
 -D Abonder
 
 D Abonder
 Director of Consulting
 Some Company
 www.SomeCompany.com
 
 Email: dgon***@somecompany.com
 Phone: 123-555-3450</ProblemResolution></Incident> You may have to add an xml header to the file including the xml version:
<?xml version = 2.0?>. The header of the xml file can also include namespaces. Finally, you may want to add the ROOT keyword to your SQL to generate a ROOT element to make it into a legal XML file: Select ProblemResolution From Incident Where RowID = 2 FOR XML AUTO, ELEMENTS, ROOT('Incident') -- Show quoteMark Stricker "Amos Soma" wrote: > I have a column ('ProblemResolution') in a table ('Incident') that holds > plain text. I am doing a query against that column and converting the > results to XML as follows: > > Select ProblemResolution From Incident Where RowID = 2 FOR XML AUTO, > ELEMENTS > > The problem is the XML that is being generated. It appears the XML that is > generated is illegal (in some cases) because if I save the resulting XML in > a text file and load into Internet Explorer, IE generates errors. > > Here is the plain text (actually part of it - enough to demo the problem) as > stored in the column. The quotes are not stored. > > "8/11/2006 dabonder - > Carol - > > Thanks for the detail. I looked at the 6060 transaction and it was as you > thought - these accounts are not set up in the .| > If the corresponding project account to 6060 would never be used in a time > sheet or expense report then you would not need to have a. > I haven't had time to clarify this. If you want to discuss when you get time > I would be happy to. > > -D Abonder > > D Abonder > Director of Consulting > Some Company > www.SomeCompany.com > > Email: dgon***@somecompany.com > Phone: 123-555-3450" > > Here is the generated (illegal) XML: > > <Incident><ProblemResolution>8/11/2006 dabonder - > > Carol - > > Thanks for the detail. I looked at the 6060 transaction and it was as you > thought - these accounts are not set up in the . > > If the corresponding project account to 6060 would never be used in a time > sheet or expense report then you would not need to have a. > > I haven't had time to clarify this. If you want to discuss when you get > time I would be happy to. > > -D Abonder > > D Abonder > Director of Consulting > Some Company > www.SomeCompany.com > > Email: dgon***@somecompany.com > Phone: 123-555-3450</ProblemResolution></Incident> > > > Thanks Mark but that isn't the problem. The problem seems to be related to
the fact that there is an apostrophe in the text and a couple '-' characters. If I remove those, IE has no problem. Show quote "Mark Stricker" <MarkStric***@discussions.microsoft.com> wrote in message news:0BE21A54-9F63-4E40-8198-D9751EBAFBD3@microsoft.com... > You may have to add an xml header to the file including the xml version: > > <?xml version = 2.0?>. > > The header of the xml file can also include namespaces. Finally, you may > want to add the ROOT keyword to your SQL to generate a ROOT element to > make > it into a legal XML file: > > Select ProblemResolution From Incident Where RowID = 2 FOR XML AUTO, > ELEMENTS, ROOT('Incident') > > > -- > Mark Stricker > > > "Amos Soma" wrote: > >> I have a column ('ProblemResolution') in a table ('Incident') that holds >> plain text. I am doing a query against that column and converting the >> results to XML as follows: >> >> Select ProblemResolution From Incident Where RowID = 2 FOR XML AUTO, >> ELEMENTS >> >> The problem is the XML that is being generated. It appears the XML that >> is >> generated is illegal (in some cases) because if I save the resulting XML >> in >> a text file and load into Internet Explorer, IE generates errors. >> >> Here is the plain text (actually part of it - enough to demo the problem) >> as >> stored in the column. The quotes are not stored. >> >> "8/11/2006 dabonder - >> Carol - >> >> Thanks for the detail. I looked at the 6060 transaction and it was as you >> thought - these accounts are not set up in the .| >> If the corresponding project account to 6060 would never be used in a >> time >> sheet or expense report then you would not need to have a. >> I haven't had time to clarify this. If you want to discuss when you get >> time >> I would be happy to. >> >> -D Abonder >> >> D Abonder >> Director of Consulting >> Some Company >> www.SomeCompany.com >> >> Email: dgon***@somecompany.com >> Phone: 123-555-3450" >> >> Here is the generated (illegal) XML: >> >> <Incident><ProblemResolution>8/11/2006 dabonder - >> >> Carol - >> >> Thanks for the detail. I looked at the 6060 transaction and it was as >> you >> thought - these accounts are not set up in the . >> >> If the corresponding project account to 6060 would never be used in a >> time >> sheet or expense report then you would not need to have a. >> >> I haven't had time to clarify this. If you want to discuss when you >> get >> time I would be happy to. >> >> -D Abonder >> >> D Abonder >> Director of Consulting >> Some Company >> www.SomeCompany.com >> >> Email: dgon***@somecompany.com >> Phone: 123-555-3450</ProblemResolution></Incident> >> >> >> |
|||||||||||||||||||||||