473,769 Members | 8,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

245 New Member
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 3759
Dormilich
8,658 Recognized Expert Moderator Expert
@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 New Member
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 Recognized Expert Moderator Expert
@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 New Member
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 GetCatHierarchy ByIdName 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 New Member
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 Recognized Expert Moderator Expert
@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 New Member
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
4560
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 <--xsl:page--> <?xml version="1.0" encoding="UTF-8"?>
4
432
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 strXML = strXML + "<WO_Step>" & vbCRLF strXML = strXML + "<Test>Test Special Characters #, %, &, <, > </Test> strXML = strXML + "</WO_Step>"
1
3473
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 value representing the width of the bmp image. So far, I have been able to use fstream's seek, write, and read to pull out chucks of bytes and convert them to usable integers straight out of the binary file. It works well, but over the course of...
7
3793
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 + trademark) --Art
25
6547
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 as a small tool function according to its quality? I will be very happy to get your suggestion from every aspect on it: interface design, C language knowledge or algorithm efficient. Sincerely,
1
4574
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, 2. Text checks for max. length of the field & whether the field is mandatory or optional Example:
1
1531
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, Sort sort) throws IOException Problem : I cant able to search the word. If the word contain special character like , %BF It just taken that special character a empty space and search the remaining character
4
2588
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! anyone know if there's a way around this? thanks folks...
6
10717
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# application and add a Paint event handler): public partial class Form1 : Form { public Form1() { InitializeComponent();
0
9589
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.