Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: I have an XML report which contains data that includes another

From: "Joe Fawcett" <joefawcett@-------.--->
To: 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 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent