473,683 Members | 3,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML: "undefined entity"

Hello,

I've xml code that looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xc:xcontent
xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent"
xmlns="http://www.w3.org/1999/xhtml">

<xc:titel type="string">< ![CDATA[Wat een he]]></xc:titel>
<xc:gelulA type="html">
<h2>HE hallo ik ben henk</h2>
<ul>
<li>
<p>hierna komt b</p>
</li>
</ul>

<p>Nou llllen dat kan ie wel zul je denken</p>

<p>&nbsp;</p>

</xc:gelulA>
</xc:xcontent>

This xml will be transformed by some xsl, but my problem:

xhtml entities like &nbsp; are not defined and there the xsl document cannot handle this xml document.
This xml document above is even not valid xml, how do i define the html entities?!?!
Jul 20 '05 #1
3 8602
In article <cn**********@n etlx020.civ.utw ente.nl>,
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
This xml document above is even not valid xml, how do i define the html
entities?!?!


You could put in a doctype declaration the includes the XHTML DTD, for
example:

<!DOCTYPE xc:content [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

or one that just includes the entity definitions:

<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
%HTMLlat1;

or one that just defines the entities you use:

<!ENTITY nbsp " ">

-- Richard
Jul 20 '05 #2
Tjerk Wolterink wrote:
Hello,

I've xml code that looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xc:xcontent
xmlns:xc="http://www.wolterinkwe bdesign.com/xml/xcontent"
xmlns="http://www.w3.org/1999/xhtml">

<xc:titel type="string">< ![CDATA[Wat een he]]></xc:titel>
<xc:gelulA type="html">
<h2>HE hallo ik ben henk</h2>
<ul>
<li>
<p>hierna komt b</p>
</li>
</ul>

<p>Nou llllen dat kan ie wel zul je denken</p>

<p>&nbsp;</p>

</xc:gelulA>
</xc:xcontent>

This xml will be transformed by some xsl, but my problem:

xhtml entities like &nbsp; are not defined and there the xsl document
cannot handle this xml document.
This xml document above is even not valid xml, how do i define the html
entities?!?!


hi,

xhtml is xml, not html ; in xml, there are only 5 predefined entities
(lt, gt, quot, apos, amp) ; others have to be defined ; however, as xml
supports unicode, you'd better use direct character entities, like this :

<p> </p>

(160 is the unicode character for "non breaking space")

--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
Jul 20 '05 #3
Tjerk Wolterink <tj***@wolterin kwebdesign.com> wrote:
<p>&nbsp;</p>


Why would you do that in the first place? In the XHTML namespace, the <p>
element means 'paragraph'. What is a paragraph that consists of a single
character, a no-break space?

In bad old days in tagsoup HTML, it was relatively common to use empty
paragraphs for formatting. It's explicitly frowned upon in the HTML
specifications. You're supposed to use style sheets for creating vertical
spacing in a document's visual rendering.

Should you wish to use the no-break space, you can enter it directly as
an ISO 8859-1 character, for example, since your declared encoding is ISO
8859-1.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #4

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

Similar topics

3
8853
by: Chung Leong | last post by:
How come there isn't a xmlspecialchars(), and for that matter, xml_entity_decode()? I would think someone would have thought of that by now.
1
2124
by: JKop | last post by:
Would you classify the following code as "Undefined Behaviour" or as "Non- portable"? signed main() { signed char chedder = 130; } Relevant information:
13
3079
by: Don Vaillancourt | last post by:
What's going on with Javascript. At the beginning there was the "undefined" value which represented an object which really didn't exist then came the null keyword. But yesterday I stumbled across "null" string. I know that I will get an "undefined" when I try to retrieve something from the DOM which doesn't exist. I have used null myself to initialize or reset variables. But in which
25
3088
by: Nitin Bhardwaj | last post by:
Well, i'm a relatively new into C( strictly speaking : well i'm a student and have been doing & studying C programming for the last 4 years).....and also a regular reader of "comp.lang.c" I don't have a copy of ANSI C89 standard,therefore i had to post this question: What is the difference between "unspecified" behaviour & "undefined" behaviour of some C Code ??
4
2518
by: Flip | last post by:
I'm seeing one of my websites giving me an error message on the page after it loads up as "WXBUnit Undefined" What does that mean? The formatting of the site is horrible! I'm not sure what is going on with it. Thanks.
49
14487
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On http://www.webreference.com/programming/javascript/gr/column9/ they say: <snip> The undefined property A relatively recent addition to JavaScript is the undefined property.
9
10727
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined as a valid return value for the typeof operator in a later version of ECMAScript or is this a JScript "feature"? -- Klaus Johannes Rusch
2
15399
by: libsfan01 | last post by:
In IE6 i get an error: "XMLHttpRequest is undefined", whereas in other browsers (e.g. ie7) it works fine: var get; function getdata(region,page) { get = new XMLHttpRequest(); get.onreadystatechange = processdata;
1
4407
by: ziycon | last post by:
Can anyone tell me what this error means in tomcat logs?
0
8568
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
8504
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8922
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
8753
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,...
1
6429
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
5789
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4299
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4519
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2934
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 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.