473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.wolterinkwebdesign.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 8573
In article <cn**********@netlx020.civ.utwente.nl>,
Tjerk Wolterink <tj***@wolterinkwebdesign.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.wolterinkwebdesign.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***@wolterinkwebdesign.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
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
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
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...
25
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...
4
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...
49
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...
9
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...
2
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();...
1
by: ziycon | last post by:
Can anyone tell me what this error means in tomcat logs?
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.