How to insert ascii characters using dom
I am having a tough time inserting ascii values in to xml text content
i search for a regular space and try insert a non breaking space in my xml whic is basically �
Infact I want to insert the ascii value of a non breaking space or for that matter ascii value of any character, I am using dom level 2.
in the code the actual replace ment string is the ascii code, somehow when I click preview, it actually shows the space instead showing the what I have in my actual code, so i had to separate in the ascii and ; in my code snippet that follows
String text = nl.item(i).getNodeValue();
System.out.println(text);
String newText = text.replaceAll("\\s", "� followed by a ;");
nl.item(i).setNodeValue(newText)it actually inserts   in the xml code for the xml document and literally "  followed by ;" appears in my document when viewed from a browser, all I am trying to do is replace a given character with an ascii value using dom. All i tried to do was replace a regular space with a non breaking space.
  won't work either, infact i tried ascii values for other characters too, i end up having the ascii value in the tag when i view the finished document in a browser.
Please help
Edited by: jaks4u on Mar 22, 2008 2:23 PM
As jtahlborn says, NBSP isn't an ASCII character. But this is Java we're working with, and XML. Neither of those two things have ever restricted themselves to the ASCII character set, and neither should you. They use Unicode, which is far larger and which does include that character. You could go to [the Unicode site|http://www.unicode.org/] and do some research -- which might broaden your horizons a lot -- but the code point for that character is (not surprisingly) 160. That's A0 in hexadecimal, so the Java character representing it ischar nbsp = '\u00a0';So use that in your code. Just make sure to output the XML document in an encoding that supports it (unlike ASCII). UTF-8 would be an excellent choice.
Similar Messages
-
How to Insert Chinese characters in Japanese Database
Hi all,
I am having following characteristics on my computer
Machine OS --Windows Server 2003
OS language --Japanese
Oracle
Oracle9i Release 9.2.0.1.0 - Production
NLS_LANGUAGE JAPANESE
NLS_CHARACTERSET JA16SJIS
Now, i want to insert into database chinese characters. Please guide me how to do the following thing.
How to insert chinese characters on local machine and if i want to insert on the remote databse (i can not create database link for remote database). I have to send batch file or SQL file and they will execute it on their side.
if i use this command
alter session set nls_language = "SIMPLIFIED CHINESE"
and then insert the records and revert back to japanese character set. Is this correct way....?
Thanks in advance,
PalAs dombrooks has pointed out, unless all the Chinese characters you are trying to store can be represented in the Shift-JIS character set, which seems unlikely, but I'm not an expert on East Asian languages and I believe there are some glyphs that are shared between various languages, then you're not going to be able to store this data in this database in CHAR or VARCHAR2 columns.
Depending on the national character set, you may be able to store the data in NCHAR/ NVARCHAR2 columns, though using these data types can substantially increase application complexities since various languages and libraries don't support NCHAR/ NVARCHAR2 columns or require you to jump through some hoops to use them. Your applications would also have to support both character sets, so your applications would all have to be Unicode enabled most likely, which is certainly possible but it may not be a trivial change.
Justin -
How to read Korean characters using Java program?
In Oracle table, i am having Korean characters, how to read those characters using JDBC and insert into SQL Server?
NLS_NCHAR_CHARACTERSET is UTF8What data type is the column in the Oracle table? The NLS_NCHAR_CHARACTERSET would control the encoding of NCHAR and NVARCHAR2 columns. The NLS_CHARACTERSET would control the encoding of CHAR and VARCHAR2 columns.
Justin -
How to insert the data using matrix
Hi
All how to insert the data using matrix feild
plz help me
thanks
LoyHi Loy,
The best way to fill an entire matrix is to use a DBDatasource, here is some sample code:
Dim oForm As SAPbouiCOM.Form
oForm = SBO_App.Forms.Item("YourFormTypeID")
'1. Add a DBDataSource to the form
oForm.DataSources.DBDataSources.Add("OUSR")
Dim oColumnDBS As SAPbouiCOM.Column
Dim oColumnUDS As SAPbouiCOM.Column
Dim i As Integer
Dim GenEdt As SAPbouiCOM.EditText
Dim oMatrix As SAPbouiCOM.Matrix
Dim oColumns As SAPbouiCOM.Columns
Dim oDBDataSource As SAPbouiCOM.DBDataSource
oMatrix = oForm.Items.Item("7").Specific
oColumns = oMatrix.Columns
'2. DBDataSource: Binding a field / alias of the table to a column
oColumnDBS = oColumns.Item("V_1")
oColumnDBS.DataBind.SetBound(True, "OUSR", "U_NAME")
'3. getting the data sources bound to the form
oDBDataSource = oForm.DataSources.DBDataSources.Item("OUSR")
oMatrix.Clear()
' Querying the DB Data source
oDBDataSource.Query()
' Adding the data to the matrix
oMatrix.LoadFromDataSource()
When you want to fill a specific field use :
GenEdt = oMatrix.Columns.Item("V_2").Cells.Item(1).Specific
GenEdt.String = "Hello" -
How to insert chinese characters in a table use FDK?
Hello~~
I am expecting to insert chinese characters in an XML file's table.
I'm using FDK7.2, if i use:
F_ApiAddText(docId, &tRange.beg, "asdf");
The English letters "asdf" can be insert correctly in the right place,
But, if insert chinese characters like this:
F_ApiAddText(docId, &tRange.beg, "人们");
No characters insert.
How can i solve this problem?
Please advise
Thanks
zhaopengZhaopeng,
Which encoding are you using for the Chinese characters? FrameMaker 7.2 does not support Unicode or UTF-8. I have not done this before, but I guess you need to supply the characters in Big5 resp. GBK encoding, see
http://help.adobe.com/en_US/FrameMaker/8.0/chinese_korean.pdf
[Ignore the 8.0 in the URL, the document talks about FrameMaker 7]
You also may have to make sure the paragraph format at your text location uses a Chinese font before inserting characters.
- Michael -
How to insert emoji characters into document?
I paid for and downloaded emoji but I cannot insert the pictures into my pages document. How do I insert emoji characters into my pages document?
Shelborne wrote:
I paid for and downloaded emoji
Why would you do that? Just use Character Viewer to input Apple's built in emoji.
OS X Yosemite: Use the Character Viewer
Pages 09 does not support color emoji, use Pages 5 instead. -
How to insert & # special characters into oracle table?
I have a text value which contains special characters such as & and #.
After I pass from one page to another,
TEST& becomes "TEST&"
I put " " on the above test, otherwise amp; will be truncated by OTN).
TEST# becomes TEST (# is truncated).
Actually the value is saved in table like this: "TEST&"
How to solve this problem?
How to insert & into table without &
Thank you.
Edited by: user628655 on Jul 27, 2009 9:47 AM
Edited by: user628655 on Jul 27, 2009 9:49 AM
Edited by: user628655 on Jul 27, 2009 10:39 AMAvoid doing that through a link. If this is a page item then submit the page and redirect to the target page using a branching. On the target page, create a computation to compute the target item using the original page item as the source. If you are talking about a report, use the id to pass through the link and fetch the text column in an on load computation.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------ -
How to insert a number using ADO or OLEDB by oracle provider
I create a talbe .
Create Table A
(id number(7));
I use ADO to access the table a;
_ConnectionPtr pConn=NULL;
pConn.CreateInstance(__uuidof(Connection));
_RecordsetPtr pRst=NULL;
pRst.CreateInstance(__uuidof(Recordset));
pConn->Provider="OraOLEDB.Oracle.1";
try
pConn->Open("","ISVISION","ISVISION",NULL);
pRst->CursorLocation=adUseClient;
pRst->Open("A",pConn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdTable);
pRst->AddNew();
pRst->Fields->Item[0L]->Value=100L;
//It raise a exception,why?
//If I convert the datetype of "ID" to CHAR(7)
//and pRst->Fields->Item[0L]->Value=L"100",it is ok.
pRst->Update();
pRst->Close();
pConn->Close();
catch (_com_error& e)
MessageBox(e.Description(),"error",MB_OK|MB_ICONWARNING);
return ;
if (pConn)
pConn.Release();
if (pRst)
pRst.Release();
I create a table Aã
create table A
ID number(7)
Now ,I use OLE DB to access the table A;
struct CIsA
CIsA()
memset(this, 0, sizeof(*this));
public:
DB_NUMERIC m_ID;
BEGIN_COLUMN_MAP(CIsA)
COLUMN_ENTRY_PS(1, 7, 0, m_ID)
END_COLUMN_MAP()
DEFINE_COMMAND(CIsA, _T("SELECT ID FROM A"))
CDataSource DataSource;
HRESULT hrt=DataSource.Open(_T("OraOLEDB.Oracle.1"),NULL,_T("ISVISION"),_T("ISVISION"));
CSession Session;
hrt=Session.Open(DataSource);
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_IRowsetChange, true);
propset.AddProperty(DBPROP_UPDATABILITY,
DBPROPVAL_UP_INSERT | DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_DELETE);
CCommand<CAccessor<CIsA> > Command;
Command.Open(Session,NULL,&propset);
tcscpy((TCHAR*)Command.mID.val,_T("1245"));
Command.m_ID.sign=1;
hrt=Command.Insert();//It is wrong,why?
Command.Close();
Session.Close();
DataSource.Close();
In Fact,the two problems is the same. The key of problem is how to insert a number into oracle.
help me! thank you.hi
create a table something like this.
create table image(
Image_Id number(5),
Image blob);create a form with the same table and use the following code.
when-button-pressed trigger.
read_image_file('c:\image_name.jpg' , 'jpg' , 'image.image');if its correct/helpful please mark it thanks.
sarah -
How to insert unicode characters in oracle
hiiii...........i want to add special unicode characters in oracle database......can anyone guide me how to do this.
i kno we have nvarchar2 datatype which supports multilingual languages......but im enable to insert the values from sql prompt........can anyone guide me how to insert the values.
also please tell will there be special care which had to be taken care of if we are accessing it through .NET??output of
select * from nls_database_parameters where parameter like '%SET';
is PARAMETER VALUE
NLS_CHARACTERSET WE8MSWIN1252
NLS_NCHAR_CHARACTERSET AL16UTF16
when i query :select testmsg, dump(testmsg,1016) from test ;
i get
TESTMSG DUMP(TESTMSG,1016)
éµOF¿¿ad¿ Typ=1 Len=18 CharacterSet=AL16UTF16: 0,e9,0,b5,0,4f,0,46,0,bf,0,bf,0,61,0,64,0,bf
dsdas Typ=1 Len=10 CharacterSet=AL16UTF16: 0,64,0,73,0,64,0,61,0,73
éµOF¿¿ad¿ Typ=1 Len=18 CharacterSet=AL16UTF16: 0,e9,0,b5,0,4f,0,46,0,bf,0,bf,0,61,0,64,0,bf
éµOF¿¿ad¿ Typ=1 Len=18 CharacterSet=AL16UTF16: 0,e9,0,b5,0,4f,0,46,0,bf,0,bf,0,61,0,64,0,bf
what basically i want is to store some special characters like éµΩΦЛήαδӨװΘ§³¼αγ into my oracle database but i am unable to do dat....
Edited by: [email protected] on Jun 28, 2010 10:19 PM
Edited by: [email protected] on Jun 28, 2010 10:54 PM -
How to insert special characters in pdf comments
Now, we are ready to go "no paper" workflow, and so mark anything on pdf file, but we cannot insert most of special characters in PDF comments. Same as here, and the xml entity is "&PSgr;", "how to archive it?
>what the Character Map is?
You don't know how to use Google?
Character map is a standard part of Windows for using special
characters with any program.
In Windows XP, Start > All Programs > Accessories > System Tools >
Character Map.
Aandi Inston -
How to insert Serialised Object(XML DOM) into Oracle Table(as BLOB or CLOB)
we need a urgent help. How can we insert and retrieve the XML Document DOM Object into Oracle Table.Actually we used BLOB for insert the DOM Object,its inserted finely but we have a problem in retrieving that object, we got error when v're retrieving. so could you anyone tell us what's this exact problem and how can we reslove this problem If anyone knows or used this kind operation, pls let us know immediately.
Thanks in advance.Please repost your question in the appropriate XML forum, http://forums.oracle.com/forums/index.jsp?cat=51
-
How to insert special characters ,?
Hi, guys
I want to insert some special characters such as , ,,into Oracle,
for instant: insert into test (special_no) values (' ');
but the system can not read and show the characters, and just process the characters as null. Could you please tell how I can do to make the system can read the characters? Maybe should I change the some Oracle environment parameters?
By the way, I immigrated data and tables from MiniSQL to Oracle. How can I check the all data immigrated are correct? In the Mini SQL there is a command 'realshow' to show all data and tables in the database. Is there a command like this in Oracle?
Thanks ahead.
AgurriNLS_LANG could help but I am not sure about that. You should be able to get any character in the database, that the database supports. What character set is the database created with ?
You can also use the numeric value for the char
insert into x (y) values (chr(13)); or whatever.
Ronald.
http://ronr.nl/unix-dba -
How to insert variable value using select statement - Oracle function
Hi,
I have a function which inserts record on basis of some condition
INSERT INTO Case
Case_ID,
Case_Status,
Closure_Code,
Closure_Date
SELECT newCaseID,
caseStatus,
Closure_Code,
Closure_Date,
FROM Case
WHERE Case_ID = caseID
Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
how can i use this.
thanksHi,
I have a function which inserts record on basis of some condition
INSERT INTO Case
Case_ID,
Case_Status,
Closure_Code,
Closure_Date
SELECT newCaseID,
caseStatus,
Closure_Code,
Closure_Date,
FROM Case
WHERE Case_ID = caseID
Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
how can i use this. Do not select Case_Status from inner select, so null will be inserted then after inserting it update the case status with m_caseStatus.
Regards. -
How to insert the records using sql query
hi,
i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
how can i solve this problem?
Regards,
M.Thippa ReddyYou are not support use Insert / Update / Delete on SAP Databases directly.
SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E¬e_numm=896891] -
How to insert delay without using loops, and how can I use variable to store data in labview
Hi all,
I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
I have one more question, I know its a bad practice to post 2 questions in 1 thread.
How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
Thanks in advance.Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
Try to take over the world!
Maybe you are looking for
-
Hp laserjet pro mfp m125-m126 pclmS, x86 driver. operation could not be conplited
unable to install hp laserjet pro mfp m125-m126 pclmS, x86 driver. operation could not be conplited
-
I already have Elements 8 installed on my old laptop. I got a new laptop and need to take it off my old computer and install it on my new one. Is this possible or do I need to buy a new program?
-
Shared Photo stream doesn't work? (note: Photostream does)
I Have the new 5s and I set up iCloud. My Photo Stream works fine. If I take pictures on my iPad, they show up on my iphone no problem. BUT I noticed that none of the SHARED photo albums I had before are showing up on my iPhone. Also, if I create a s
-
Dynamic variant calling multiple screens
Hi all, The concerned issue is that i am trying to execute a report( which on execution throws a selection screen) from a program using 'submit' statement passing a variant. along with it iam creating a dynamic varinat using FM RS_CREATE_VARIANT, the
-
Upgraded to DW CC 2014.1, FTP/SFTP isn't working at all
There's a HostNexus webserver I usually connect to but since I upgraded to DW CC 2014, it only spits back errors. I can connect successfully to the server in FileZilla (using FTP explicit). I've looked through the forum and tried various suggestions