Embedding degree symbol etc. in XML extract files

T

T Kennedy

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.
 
J

Jukka K. Korpela

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.
 
S

Shmuel (Seymour J.) Metz

on 04/23/2005 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 address removed)
 
I

Ian Wilson

Shmuel said:
In <[email protected]>, on 04/23/2005
at 08:50 AM, (e-mail address removed) (T Kennedy) said:




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).
 
J

Jan Roland Eriksson

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,841
Latest member
WilmerBelg

Latest Threads

Top