473,396 Members | 1,655 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,396 software developers and data experts.

how to write special character string "Broschüren" into this format Broschüren

245 100+
Hey all,
I am creating a xml file in this format

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" standalone="yes"?>
  2. <customers>
  3.   <customer>
  4.     <category>Brosch&uuml;ren</category>
  5.     <number>4</number>
  6.     <email>abc@xyz.net</email>
  7.     <name>ABC XYZ</name>
  8.     <farben>4</farben>
  9.     <preflight>1</preflight>
  10.     <format>148 210</format>
  11.     <paper>135</paper>
  12.   </customer>
  13. </customers>
  14.  
But i want category tag in this format which shows special charactor.

Expand|Select|Wrap|Line Numbers
  1. <category>Broschüren</category>
  2.  
In database category values are saved in this format Brosch&uuml;ren but when i create xml then i want it shows category in this fornat Broschüren

If some one help me out to sort out my problem then i will be very grateful to him/her.

I am using DOMDocument in order to create xml file at run/execution time. and here is my method of creating xml document

Expand|Select|Wrap|Line Numbers
  1. $dom = new DOMDocument("1.0", "utf-8");
  2. $dom->xmlStandalone = true;

Awaiting a positive response from this great community
Oct 13 '09 #1
7 3732
Dormilich
8,658 Expert Mod 8TB
@neovantage
should be doable… ;)

@neovantage
ah, from me, that is. (in this forum, mostly)

ok, b2b. I’m not aware that you can convert these entities, once the xml is loaded (I’ve experienced decimal entities being converted). but you can always run htmlentities() on the input string beforehand.
Oct 13 '09 #2
neovantage
245 100+
htmlentities() is used to convert those special chractors into string but i have already string. i need to convert string into special charactor while creating an xml.

i mean i need to convert &uuml; to ü while writing my content into xml file
Oct 13 '09 #3
Dormilich
8,658 Expert Mod 8TB
@neovantage
outside XML those entities are nothing but regular characters.
@neovantage
do it before creating the XML

PS. it’s character, not charactor
Oct 13 '09 #4
neovantage
245 100+
I am doing this before creating XML. here is my code

Expand|Select|Wrap|Line Numbers
  1. $nameval=$myCategory->GetCatHierarchyByIdName(FormatString($_POST['cat_id'],"int"),'*');
  2. $nameval=htmlentities($nameval);
  3. $dom = new DOMDocument("1.0", "utf-8");
  4. $dom->xmlStandalone = true;
  5.  
function GetCatHierarchyByIdName returns category name and it saved in variable $nameval and i am aplying htmlentities() function before creating XML File

But it is not working
Oct 13 '09 #5
neovantage
245 100+
Even this technique is also not working

Expand|Select|Wrap|Line Numbers
  1. $nameval=$myCategory->GetCatHierarchyByIdName(FormatString($_POST['cat_id'],"int"),'*');
  2.             $nameval=str_replace("&auml;","ä",$nameval);
  3.             $nameval=str_replace("&ouml;","ö",$nameval);
  4.             $nameval=str_replace("&uuml;","ü",$nameval);
Oct 13 '09 #6
Dormilich
8,658 Expert Mod 8TB
@neovantage
of course not, htmlentities()’s default charset is ISO-8859-1

PS. probably the same reason for the other way
Oct 13 '09 #7
neovantage
245 100+
Thanks it works on remote server
Oct 13 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bal | last post by:
Hi, I am trying to generate a pdf using a XML file and rendering the page through XSL Stylesheet to a PDF. But the page has some special characters, as its for a chequ website. My Code below is...
4
by: Norman Uhlenkott | last post by:
I would like to be able to put in special character inside an xml data string (#, <, >, &). when it trys to parses out the XML String it errors out strXML = "<?xml version='1.0'?>" & vbCRLF...
1
by: rusttree | last post by:
I'm working on a program that manipulates bmp files. I know the offset location of each piece of relevent data within the bmp file. For example, I know the 18th through 21st byte is an integer...
7
by: Art M | last post by:
I saved an html page the other day that encoded some punctuation with codes like â?T --> apostrophe (in case those characters don't show up in your news reader that's a_circumflex + euro +...
25
by: lovecreatesbeauty | last post by:
Hello experts, I write a function named palindrome to determine if a character string is palindromic, and test it with some example strings. Is it suitable to add it to a company/project library...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
1
by: Ragavendran | last post by:
Hi, I am using this method for search: Query =org.apache.lucene.queryParser.QueryParser.parse(String arg0) throws ParseException Hits = org.apache.lucene.search.Searcher.search(Query query,...
4
by: forest demon | last post by:
i've been trying to create a code snippet that would contain a special character...i.e. a trademark symbol (™). but to no avail. whether in the CDATA section or a literal definition, no workie!...
6
vekipeki
by: vekipeki | last post by:
I am having a problem with basic drawing of unicode characters in Windows 2000 and XP. I have written a simplest possible C# WinForms program to test it (just create a new Windows Forms C#...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.