Embedding degree symbol etc. in XML extract files

Discussion in 'XML' started by T Kennedy, Apr 23, 2005.

  1. T Kennedy

    T Kennedy Guest

    Hi,

    We currently use XML to pass data to a seperate system. We need to be
    able to embed scientific characters e.g. degree symbol as part of the
    XML file. How can this be done?

    Does it work in a similar way to HTML, where you can use the '&'
    notation to parse the character correctly.

    Any help greatly appreciated.

    Tony.
    T Kennedy, Apr 23, 2005
    #1
    1. Advertising

  2. (T Kennedy) wrote:

    > We currently use XML to pass data to a seperate system. We need to be
    > able to embed scientific characters e.g. degree symbol as part of the
    > XML file. How can this be done?


    If you XML files are UTF-8 (or UTF-16) encoded, you can enter the
    characters as such. How you do that depends on the authoring or
    conversion tool you use to produce XML files.

    > Does it work in a similar way to HTML, where you can use the '&'
    > notation to parse the character correctly.


    Character references, such as ° or ° for the degree sign, can
    be used in XML as well. Entity references, such as °, can be used
    only if you have defined the entities; they are _not_ predefined in XML
    as they are in HTML.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Apr 24, 2005
    #2
    1. Advertising

  3. In <>, on 04/23/2005
    at 08:50 AM, (T Kennedy) said:

    >We currently use XML to pass data to a seperate system. We need to be
    >able to embed scientific characters e.g. degree symbol as part of the
    >XML file. How can this be done?


    Since XML is an SGML document type, and since XML is more immediately
    derived from HTML, I would assume that you can use the standard
    entities for special characters. If there is no entity defined for
    degree, then you should still be able to explicitly reference its code
    point with &# notation.

    --
    Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

    Unsolicited bulk E-mail subject to legal action. I reserve the
    right to publicly post or ridicule any abusive E-mail. Reply to
    domain Patriot dot net user shmuel+news to contact me. Do not
    reply to
    Shmuel (Seymour J.) Metz, Apr 26, 2005
    #3
  4. T Kennedy

    Ian Wilson Guest

    Shmuel (Seymour J.) Metz wrote:
    > In <>, on 04/23/2005
    > at 08:50 AM, (T Kennedy) said:
    >
    >
    >>We currently use XML to pass data to a seperate system. We need to be
    >>able to embed scientific characters e.g. degree symbol as part of the
    >>XML file. How can this be done?

    >
    >
    > Since XML is an SGML document type, and since XML is more immediately
    > derived from HTML, I would assume that you can use the standard
    > entities for special characters.


    AFAIK the only entities predefined in XML are a few like &amp; and &lt;
    required so that markup is unambigously discernable. If you want
    entities for scientific symbols you have to define them in your XML (or
    presumably in an included file).

    > If there is no entity defined for
    > degree, then you should still be able to explicitly reference its code
    > point with &# notation.
    Ian Wilson, Apr 26, 2005
    #4
  5. On Tue, 26 Apr 2005 10:03:55 -0300, "Shmuel (Seymour J.) Metz"
    <> wrote:

    >In <>, on 04/23/2005
    > at 08:50 AM, (T Kennedy) said:
    >
    >>We currently use XML to pass data to a seperate system. We need to be
    >>able to embed scientific characters e.g. degree symbol as part of the
    >>XML file. How can this be done?

    >
    >Since XML is an SGML document type...


    "_document_type_"?

    Are you sure about that?

    >...and since XML is more immediately derived from HTML


    Huh? Are you _really_ sure about that?

    >I would assume that you can use the standard entities for special
    >characters.


    Not in "well formed only" xml instances.

    >If there is no entity defined for degree, then you should still
    >be able to explicitly reference its code point with &# notation.


    The &#xxxx number notation is usable, yes.

    --
    Rex
    Jan Roland Eriksson, Apr 26, 2005
    #5
    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. Dingbat
    Replies:
    1
    Views:
    1,291
    David Carlisle
    Apr 29, 2005
  2. Ayron
    Replies:
    5
    Views:
    3,292
    Johannes Koch
    Nov 12, 2005
  3. Matt Chwastek
    Replies:
    6
    Views:
    505
    Michael Angelo Ravera
    Nov 20, 2006
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    370
    Fredrik Lundh
    Aug 13, 2008
  5. Replies:
    1
    Views:
    139
    Anno Siegel
    Oct 31, 2005
Loading...

Share This Page