Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: I have an XML report which contains data that includes another [Thread Next] Re: I have an XML report which contains data that includes anotherTo: NULL Date: 12/1/2004 11:51:00 AM "Martin Hallerbach" <MartinHallerbach@d...> wrote in message news:36F1910F-EB4D-4020-B976-5A7003FED835@m...... > > > "Joe Fawcett" wrote: > >> "Martin Hallerbach" <MartinHallerbach@d...> wrote in >> message news:DAE2A347-AAB8-40BE-AF34-4FF0BFFD7940@m...... >> > Hi Joe, >> > >> > "Joe Fawcett" wrote: >> > >> > > "WTH" <nospam@s...> wrote in message >> > > news:%23w7T1Km1EHA.2824@T...... >> > > > ...and everything is great until my dispay code (using mshtml) runs >> into >> > > the >> > > > <?xml version="1.0" encoding="utf-16" standalone="yes"?> statement >> > > > in >> the >> > >> > I've got the same Problem as WTH having the declaration line at the top >> > of >> > the main document : >> > >> > > > XML code contained within a sub section of the report. Then the >> parser >> > > > chokes with "Switch from current encoding to specified encoding not >> > > > supported". Is there some way to 'wrap' this up so the parser >> > > > ignores >> it >> > > > and yet visually the user viewing the report can see the XML? >> > > > >> > > > I could just strip out the encoding, but then the user is not >> > > > seeing >> > > > everything. >> > > > >> > > > Thanks, >> > > > >> > > > WTH >> > > > >> > > >> > > You need to correct the declaration then to specify the true encoding >> > > by >> > > making either the main document utf-16 or change the sub document >> encoding >> > > to be correct. >> > How do I make the main doc to be UTF-16 encoded??? >> > >> > Do I have to use msxml to create a well formed document which has the >> > correct encoding or can this be done on a more simple way (by simply >> > using >> > editor or wordpad or something like that??) >> > >> > >> > Thanks >> > >> > Martin >> > > >> > > -- >> > > >> > > Joe (MVP - XML) >> > > >> > > >> Is the whole document XML? In which case you should only have one >> declaration, not two? >> If not how is the document created? For example if you copy the text into >> Notepad and save with UTF-* encoding then you need to change the >> declaration >> to be utf-8. >> >> Joe >> >> >> > > All right. just go into a discussion helps to think, look and SEE :-)) > > I found the MSXML2.MXXMLWriter in the object library, which has the > encoding > property. I think this does the work I need. > Next step is to find out how to assemble my data (coming from an access db > which I patched together) in an DOMDoc and write it to disk using > MXXMLWriter. > > If the previously said is correct, my last question on this is: Where can > I > look up examples to WRITE data INTO an XML file rather than loading and > parsing one, i.e. is there stuff to read somewhere without having me buy > a > book?-) > You can always write your data to an adodb.stream. You can then set the encoding before using saveToFile. If you call the save method of DomDocument then if there is no encoding specified it will be utf-16. -- Joe | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
