Hey all,
I am creating a xml file in this format -
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-
<customers>
-
<customer>
-
<category>Broschüren</category>
-
<number>4</number>
-
<email>abc@xyz.net</email>
-
<name>ABC XYZ</name>
-
<farben>4</farben>
-
<preflight>1</preflight>
-
<format>148 210</format>
-
<paper>135</paper>
-
</customer>
-
</customers>
-
But i want category tag in this format which shows special charactor. -
<category>Broschüren</category>
-
In database category values are saved in this format Broschü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 - $dom = new DOMDocument("1.0", "utf-8");
-
$dom->xmlStandalone = true;
Awaiting a positive response from this great community
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.
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 ü to ü while writing my content into xml file
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
I am doing this before creating XML. here is my code -
$nameval=$myCategory->GetCatHierarchyByIdName(FormatString($_POST['cat_id'],"int"),'*');
-
$nameval=htmlentities($nameval);
-
$dom = new DOMDocument("1.0", "utf-8");
-
$dom->xmlStandalone = true;
-
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
Even this technique is also not working - $nameval=$myCategory->GetCatHierarchyByIdName(FormatString($_POST['cat_id'],"int"),'*');
-
$nameval=str_replace("ä","ä",$nameval);
-
$nameval=str_replace("ö","ö",$nameval);
-
$nameval=str_replace("ü","ü",$nameval);
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
Thanks it works on remote server
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
<--xsl:page-->
<?xml version="1.0" encoding="UTF-8"?>
|
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>"
|
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...
|
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
|
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,
| |
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:
|
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
|
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...
|
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();
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |