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 3732 @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
@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 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
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);
@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...
|
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: 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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
|
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,...
| |