Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Embedding degree symbol etc. in XML extract files

Reply
Thread Tools

Embedding degree symbol etc. in XML extract files

 
 
T Kennedy
Guest
Posts: n/a
 
      04-23-2005
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.
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-24-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) (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/
 
Reply With Quote
 
 
 
 
Shmuel (Seymour J.) Metz
Guest
Posts: n/a
 
      04-26-2005
In <(E-Mail Removed) >, on 04/23/2005
at 08:50 AM, (E-Mail Removed) (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 (E-Mail Removed)

 
Reply With Quote
 
Ian Wilson
Guest
Posts: n/a
 
      04-26-2005
Shmuel (Seymour J.) Metz wrote:
> In <(E-Mail Removed) >, on 04/23/2005
> at 08:50 AM, (E-Mail Removed) (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.


 
Reply With Quote
 
Jan Roland Eriksson
Guest
Posts: n/a
 
      04-26-2005
On Tue, 26 Apr 2005 10:03:55 -0300, "Shmuel (Seymour J.) Metz"
<(E-Mail Removed)> wrote:

>In <(E-Mail Removed) >, on 04/23/2005
> at 08:50 AM, (E-Mail Removed) (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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 year AAS degree (w/certs) vs. 4 year CIS degree smolderingwick Microsoft Certification 0 02-06-2011 04:44 PM
converting MCSE degree to university degree mcp farahani MCSE 2 11-13-2009 06:53 PM
Temperature degree symbol Ryka Computer Support 29 11-23-2007 08:01 AM
Counting down an integer vector from the highest degree (111) to the lowest degree (000) Matt Chwastek C++ 6 11-20-2006 10:51 PM
Displaying the degree symbol using XSLT Dingbat XML 1 04-29-2005 02:04 PM



Advertisments