XML and special characters ...

Discussion in 'XML' started by Alan Searle, Nov 27, 2005.

  1. Alan Searle

    Alan Searle Guest

    For reporting purposes I generate XML from an MS-Access 2002 database
    and find that in this way I can format and display the data no problem
    with a XSL/HTML template. Perfect!

    However, then I found that I needed to replace my automatic MS-Access
    output with a customised dump of the XML and find that I am now having a
    problem with special characters (umlauts).

    For my tests I have built two identical extracts one generated by
    MS-Access and the other constructed by me using VBA. Here I find that
    my (VBA generated) version produces an error message 'illegal
    characters' (stopping at the point where umlauts: ä and ü are found) in
    the browser while the MS-Access generated version still displays.

    It can't be anthing in the content because both files are identical so I
    am wondering whether I need to make any specific declarations when I
    open the text file in VBA? Are there any hidden commands which indicate
    which characterset the file will contain?

    Any tips or links on the issue of handling special characters in XML
    would be a great help.

    Many thanks,
    Alan Searle
    Alan Searle, Nov 27, 2005
    #1
    1. Advertising

  2. On Sun, 27 Nov 2005, Alan Searle wrote:

    > Any tips or links on the issue of handling special characters in XML
    > would be a great help.


    If you write all special, non-ASCII characters as ä or ü
    you don't have to worry.

    --
    Netscape 3.04 does everything I need, and it's utterly reliable.
    Why should I switch? Peter T. Daniels in <news:sci.lang>
    Andreas Prilop, Nov 30, 2005
    #2
    1. Advertising

  3. Alan Searle

    Peter Flynn Guest

    Alan Searle wrote:

    > For reporting purposes I generate XML from an MS-Access 2002 database
    > and find that in this way I can format and display the data no problem
    > with a XSL/HTML template. Perfect!
    >
    > However, then I found that I needed to replace my automatic MS-Access
    > output with a customised dump of the XML and find that I am now having
    > a problem with special characters (umlauts).
    >
    > For my tests I have built two identical extracts one generated by
    > MS-Access and the other constructed by me using VBA. Here I find that
    > my (VBA generated) version produces an error message 'illegal
    > characters' (stopping at the point where umlauts: ä and ü are found)
    > in the browser while the MS-Access generated version still displays.
    >
    > It can't be anthing in the content because both files are identical so
    > I am wondering whether I need to make any specific declarations when I
    > open the text file in VBA? Are there any hidden commands which
    > indicate which characterset the file will contain?
    >
    > Any tips or links on the issue of handling special characters in XML
    > would be a great help.


    The default character encoding in XML is UTF-8, so unless one or other
    of your sample files specifies something else, your XML processor will
    assume UTF-8, and therefore the file that fails must be using some other
    encoding. For most western European languages, ISO-8859-1 is sufficient,
    so try prefixing the VBA file with an XML Declaration saying so:

    <?xml version="1.0" encoding="iso-8859-1"?>

    ///Peter
    --
    XML FAQ: http://xml.silmaril.ie/
    Peter Flynn, Nov 30, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Schmidbauer
    Replies:
    7
    Views:
    1,666
    Hemal Pandya
    Jul 28, 2004
  2. Stefan Mueller
    Replies:
    3
    Views:
    32,954
    Stefan Mueller
    Jul 23, 2006
  3. Replies:
    2
    Views:
    1,070
    Ingo Menger
    May 31, 2007
  4. rvino
    Replies:
    0
    Views:
    4,635
    rvino
    Aug 14, 2007
  5. majna
    Replies:
    4
    Views:
    639
    Thomas 'PointedEars' Lahn
    Sep 19, 2007
Loading...

Share This Page