473,403 Members | 2,222 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,403 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>
But i want category tag in this format which shows special charactor.

Expand|Select|Wrap|Line Numbers
  1. <category>Broschüren</category>
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 3733
8,658 Expert Mod 8TB
should be doable… ;)

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
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
8,658 Expert Mod 8TB
outside XML those entities are nothing but regular characters.
do it before creating the XML

PS. it’s character, not charactor
Oct 13 '09 #4
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;
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
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
8,658 Expert Mod 8TB
of course not, htmlentities()’s default charset is ISO-8859-1

PS. probably the same reason for the other way
Oct 13 '09 #7
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

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...
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...
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...
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 +...
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...
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,...
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,...
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!...
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#...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.