473,549 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML aext area -> xml

Hi,

i have a strange problem and don't know where to look for the bug. Ok, i
have an html form witha text area.
Very roughly i make something like this (PHP 4.2.3, i can't update the
version):

------
$DomDocument = xmldoc('<'.'?xm l version=\'1.0\'
encoding=\'ISO-8859-1\'?'.'><pages/>');

$root = $DomDocument->root();

$element = $DomDocument->create_text_no de(utf8_encode( $content));
//$content ist die Textarea
$root->add_child($ele ment);

$handle1, $DomDocument->dumpmem("file. xml");
------

This works in every case. Especially the conversion of utf8 Strings and then
having a good ISO... file after the dump works in every case, until now with
my text area:

The file contains a lot of entities. The returns are displayed as etc.
But if i write $content into a file, everything is fine.
In the html form the character set is also set to iso-8859-1.

Where do the entities come from and how can i avoid them?

Regards,
Frank
Jul 17 '05 #1
2 1609
If you want to see a better method of dealing with multi-byte characters in
an XML file then take a look at
http://www.tonymarston.co.uk/php-mys...tml#multi-byte

You should also be aware that an XML file is only supposed to contain data,
not any HTML tags, which is why they are converted into entities.

When using an XML file in an XSL transformation all the HTML tags are
supposed to be generate by the XSL stylesheet and not ported across from the
XML data.

Tony Marston
http://www.tonymarston.net/

"Frank Thorstens" <Fr************ @gmx.de> wrote in message
news:c0******** *****@ID-202045.news.uni-berlin.de...
Hi,

i have a strange problem and don't know where to look for the bug. Ok, i
have an html form witha text area.
Very roughly i make something like this (PHP 4.2.3, i can't update the
version):

------
$DomDocument = xmldoc('<'.'?xm l version=\'1.0\'
encoding=\'ISO-8859-1\'?'.'><pages/>');

$root = $DomDocument->root();

$element = $DomDocument->create_text_no de(utf8_encode( $content));
//$content ist die Textarea
$root->add_child($ele ment);

$handle1, $DomDocument->dumpmem("file. xml");
------

This works in every case. Especially the conversion of utf8 Strings and then having a good ISO... file after the dump works in every case, until now with my text area:

The file contains a lot of entities. The returns are displayed as etc. But if i write $content into a file, everything is fine.
In the html form the character set is also set to iso-8859-1.

Where do the entities come from and how can i avoid them?

Regards,
Frank

Jul 17 '05 #2
Hi,

thanks for your reply!
If you want to see a better method of dealing with multi-byte characters in an XML file then take a look at
http://www.tonymarston.co.uk/php-mys...tml#multi-byte
Hm, ok, so mb_convert_enco ding($value,'UT F-8','ISO-8859-1');
works in another way than utf8_encode($va lue). ?
You should also be aware that an XML file is only supposed to contain data, not any HTML tags, which is why they are converted into entities.
That's clear, but why are the german Umlaute (ä, ö) encoded and also the
returns? Thats my main problem.
When using an XML file in an XSL transformation all the HTML tags are
supposed to be generate by the XSL stylesheet and not ported across from the XML data.


But i'm not using any XSL transformation. It's very strange. It seems to
have s.th to do with the data coming from the html form. :-/

Regards,
Frank
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3171
by: Mike Wilcox | last post by:
I have the following two files used to insert data into a database. when meinsert.php is executed a blank record is inserted in the database as if the .php file is not receiving the variables. Any ideas why this might be happening? Environment is stock RH9 with no updates. I believe it is PHP 4.2.2 and Apache 2.0.40. Thanks, Mike
1
3582
by: dSchwartz | last post by:
I am creating a totally adminable news system in asp.net (C#, SQL server). what i want to accomplish is allow multiple news templates to be read by an admin area. heres how it works (hopefully): an artist creates a news template (html file), drops it into a specific directory, now a client can choose that template and edit a certain number...
33
4738
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show that happening. But if you look at it in Firefox you can see the small gap of white where the semi-circle image is broken. I've tried changing...
6
1636
by: SRafiq | last post by:
Hi I need help with a topic I have an html page and in it i have a textarea which can have a multiple of info, is there any possible way that i can out put a specific area of the textarea using javascript or no its not possible.
10
12622
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can add text, images, or HTML to the box. This seems to work fine in FireFox, but not in IE. You can see the problem here: ...
1
1321
by: Jason Ho | last post by:
Hi All, In web page, we can make a HTML Area text box for user to input content (e.g. text, font size, picture) and switch to HTML code with some WYSIWYG control. I am writing a VB.NET windows form application that need to have a similar HTML Area that can input content or switch to view HTML code. I think this can make use of Rich Text...
1
2420
Haitashi
by: Haitashi | last post by:
Hi guys! First off let me explain that I know it's not possible to output html in a text area and expect it to appear rendered. =) I'm trying to come up with a solution. Basically, I receive from my database a field that contains html. Something like: <b>Awesome!</b> <br />
10
6935
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114....
1
3566
by: phpmagesh | last post by:
Hi All, I have problem in the html page I have flash banner at the top of the page and i have menu in the same flash. this flash will cover the content area. so to access content area i used high z-index value in the content area. at the same time i want to access flash menu also. If i use high z-index value in flash menu i can access...
0
7560
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...
0
7487
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7758
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7517
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...
1
5401
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...
0
3530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1093
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
800
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...

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.