472,374 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 8502
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?
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.