473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

invalid characters in tag name

jc
Hi, I want to build a xml translation map as the following

<A english sentence, with punctuations such as "?">translation of this
sentence in some language in utf8 </A english sentence, with
punctuations such as "?">

My question
1) is there a standard way doing what I want to do?
2) if not, then how do I escape the possible "," and "?" in the
sentence in the tag name? because "&" is not allowed in tag name
either

Thanks in advacne
Jul 20 '05 #1
4 4431

"jc" <jc***@post.com> wrote in message
news:d6**************************@posting.google.c om...
Hi, I want to build a xml translation map as the following

<A english sentence, with punctuations such as "?">translation of this
sentence in some language in utf8 </A english sentence, with
punctuations such as "?">

My question
1) is there a standard way doing what I want to do?
2) if not, then how do I escape the possible "," and "?" in the
sentence in the tag name? because "&" is not allowed in tag name
either

Hi,

Whitespace isnt allowed either in a tag name. I dont believe there is a
way to escape any of the illegal characters. Your question indicates,
though, that you are misapplying XML concepts. The "sentence" you are
dealing with is "data" and you are attempting to put it into "markup". The
two should never mix - that is the whole point of having a markup language.
Perhaps you can describe what problem you are trying to solve?

Regards,
Kenneth
Jul 20 '05 #2
<?xml version='1.0' encoding='utf-8'?>
<A>
<A1 xml:lang="en">english sentence, with punctuations such as "?"</A1>
<A2 xml:lang="whatever">of this sentence in some language </A1>
</A>

Don't confuse language and encoding (utf-8). The encoding applies to the
entire file and UTF-8 is a fine choice and can encode any unicode
characters, which means any language.

The only characters that need to be escaped in XML text as shown above are
"<" and "&". Write these as the character entities "&lt;" and "&amp;"
respectiviely and you should be fine.
"jc" <jc***@post.com> wrote in message
news:d6**************************@posting.google.c om...
Hi, I want to build a xml translation map as the following

<A english sentence, with punctuations such as "?">translation of this
sentence in some language in utf8 </A english sentence, with
punctuations such as "?">

My question
1) is there a standard way doing what I want to do?
2) if not, then how do I escape the possible "," and "?" in the
sentence in the tag name? because "&" is not allowed in tag name
either

Thanks in advacne

Jul 20 '05 #3
jc
I want to have translation for different languages. so russian.xml will
have <my_sentence>russian sentence</my_sentence>; and chinese.xml will
have <my_sentence>chinese sentence</my_sentence>, etc. The xml file will
be parsed at loading time and proper translated message will be
displayed at run time. I am trying to use the english as the lookup key
for its equivalent translation. the "sentence" is data, but here it is
more of just a key to the the real data. Is there a way to tell parser
not to parse the tagname, something like <CDATA>? Or may be xml is just
the format for doing what I want to do.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

"jc" <an*******@devdex.com> wrote in message
news:3f*********************@news.frii.net...
I want to have translation for different languages. so russian.xml will
have <my_sentence>russian sentence</my_sentence>; and chinese.xml will
have <my_sentence>chinese sentence</my_sentence>, etc. The xml file will
be parsed at loading time and proper translated message will be
displayed at run time. I am trying to use the english as the lookup key
for its equivalent translation. the "sentence" is data, but here it is
more of just a key to the the real data. Is there a way to tell parser
not to parse the tagname, something like <CDATA>? Or may be xml is just
the format for doing what I want to do.

Hi,

Wont the following work for you :

<sentence lang="ru">Russian sentence</sentence>
<sentence lang="zh">Chinese sentence</sentence>

...or alternatively :

<sentence>
<lang>ru</lang>
<text>Russian sentence</text>
</sentence>
<sentence>
<lang>zh</lang>
<text>Chinese sentence</text>
</sentence>

...or

<sentence>
<lang name="ru">Russian sentence</lang>
<lang name="zh">Chinese sentence</lang>
</sentence>

I'm sure, with a bit more effort, you can think up a few more
combinations. None of the above solutions require any sort of "escaping"
because the tags are markup and dont mix with the data that you are
interested in.

Regards,
Kenneth
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
1
by: Chief | last post by:
I am unable to load an xml document that contains Chinese characters in an attribute value. I need to load the document into and XmlDocument object and am using the XmlDocument.Load(string...
9
by: Mike MacSween | last post by:
So in preparing an export routine to send stuff to the courier company's label printing software (which is surprisingly rough, for a big company), I've discovered a few carriage returns in fields...
1
by: Gabe Moothart | last post by:
Hi, In my asp.net app, I create several controls dynamically, and set their 'ID' property to a value stored in a database, so I can reference them later. So far so good. This database field,...
0
by: Ben Holness | last post by:
Hi all, I have a system which allows users to enter a message on a (PHP) website. This message is then put into a (MySQL) Database. A perl script then picks up the message and creates an XML...
3
by: Anders Jansson | last post by:
Hi all. I have 2 problems when I try to open and convert an ASP.NET VS 2003 web-applikation in VS 2005. In VS 2003 I have no problems at all! First: One subfolder with will not be converted!...
1
by: romiko2000 | last post by:
Hi Folks, I got a weird problem, I create an XMLWriter to post a document via the webrequest stream and after running a network trace, I notice the data is prefixed with 3 invalid characters! ...
1
mahet
by: mahet | last post by:
Anders Jansson was a guest here, and he was having problem: When I try to build the web, this error is displayed: ---> Error 5 Unable to convert input xml file content to a DataSet. Invalid...
6
by: jasmel | last post by:
Hello, Sorta new with JavaScript... so don't kill me with jargon. I am trying to make a script that will only allow text to be inputted into a textarea that is from a drop down menu. My problem...
3
by: =?Utf-8?B?Vmlub2Q=?= | last post by:
Hi All, I am facing an issue in the XmlTextWriter class in the dotnet 2.0. This is the sample code Actual XML is like this <Name>詳細仕様に</Name>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.