Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP XML builder problem with º (degrees symbol)

Status
Not open for further replies.

kenhutchings

Programmer
Jan 11, 2005
32
0
0
GB
OK I know this sounds a little odd but all will become clear (i hope)

The basics of my app are:
1. client database of products
2. select a number of products from db
3. generate xml document from selected products

Now some of the products have temperature limitations (thus the º)

Now Ive tried using ° instead of º but that created an error in the app the xml document is to be imported into.

If the º sign is in the db the asp page that generates the xml doc seems to 'lose' it and this is no good.

I know this is probably as clear as mud but thats how it is for me too.

Hope someone can help

Cheers

Ken ;0)
(XML Generator Guru in the making...)
 
Yup, gotta deal with 'em. They MUST live in XML in the &xxx; format, So you'll have to write translators back and forth.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'm not as think as you confused I am.
-----------
Flabbergasted (a.): Amazed at how much weight one has gained.
-----------
Oyster (n.): One who sprinkles their conversation with Yiddish expressions.
 
For some apps you need to use the decimal or hex version of the alternate 'encoded' name for these character entities in XML.

For reference on the decimal/hexidecimal variations:


DECIMAL: °
HEX: °

as an example you can do a manual replace of the text before outputting to the XML doc:
Code:
sYourOutputVar = replace(oYourRecordset.Field("ProductID"), chr(176), "°")

or you can use HTMLEncode which will do all of the HTML relevant encodings
Code:
sYourOutputVar = server.HTMLEncode(oYourRecordset.Field("ProductID"))

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Cheers fellas,

The HTML encode works a treat and the file imported into the app without error. MD's muchos impressed and im sorry to say I took all the credit!

Now the beta is proven i suppose i best get on and build the real thing.

Again thanks


Ken ;0)
(XML Generator Guru in the making...)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top