Page 1 of 1

xhtml/xml compliancy

Posted: Fri Oct 28, 2005 8:16 am
by wvd_vegt
Hi Sergey

My xml guru just told me that the   you use frequently in your xhtml export are not complaint and cause many problems (missing entity declarations).

She suggest that you change them to their numeric equivalent (from memory she tought it was &160; which don't cause any problems when viewing the xml. She also thought there was a unicode numeric version.

Posted: Fri Oct 28, 2005 12:35 pm
by Sergey Tkachenko
Can you give me a link to document explaining this issue?

Posted: Fri Oct 28, 2005 1:13 pm
by wvd_vegt
Hi,

The browser doesn't matter as long as it sees the output as html. But when you drop a xhtml saved as xml and removed the doctype as it's not understood by IE, it shows:

Code: Select all

The XML page cannot be displayed 
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

Parameter entity must be defined before it is used. Error processing resource 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd...

%xhtml-prefw-redecl.mod;
-^
 
then IE will not show it once two spaces are typed and this a   is inserted. This is caused by the modular design of the dtd for xhtml v1.1. which IE doesn't support.

IE shows the page correct if you insert a entity declaration like:

Code: Select all

          <!DOCTYPE html [
          <!ENTITY nbsp   " ">
          ]>
But it needs to be done for each entity used.

Firefox shows the page correctly including the docytpe and the nbsp's. BUt I'm not sure what happens if your not online and firefox can't access the dtd's url.

Code: Select all

XML Parsing Error: undefined entity
Location: file:///C:/Pim/temp/source.xml
Line Number 65, Column 25:<p>http://www.google.nl   x</p>
So bassically   needs a dtd with the entity declared to be present, < not. The sample above shows   is defined as

Posted: Sat Oct 29, 2005 4:20 pm
by Sergey Tkachenko
Added in to-do list: to add an option for saving named entities as character codes.
NBSP is not the only named character enity used.
Others are: GT, LT, AMP, and a number of characters for saving text of Symbol and Wingdings fonts.

Posted: Sat Oct 29, 2005 9:18 pm
by Rob
Please also add the option to include entity declarations for all non standard entities.

Still nbsp in xhtml.

Posted: Wed Apr 08, 2015 10:05 am
by MagnusW
Hi Sergey, I am working with your xhtml export. Seems like it still produces &nbsp; which later in my tool-chain breaks the xml parser (standard TXMLDocument)

You asked for references. According to wikipedia:)

http://en.wikipedia.org/wiki/List_of_XM ... references

the only characters escaped by &...; in xml are: quot, amp, apos, lt and gt

Posted: Fri Apr 10, 2015 6:55 am
by Sergey Tkachenko
It looks like our XHTML refers to a wrong dtd:
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
I cannot find references to character entities in it.

I will change to
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
and
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

They start from

Code: Select all

<!ENTITY % HTMLlat1 PUBLIC
   "-//W3C//ENTITIES Latin 1 for XHTML//EN"
   "xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC
   "-//W3C//ENTITIES Symbols for XHTML//EN"
   "xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC
   "-//W3C//ENTITIES Special for XHTML//EN"
   "xhtml-special.ent">
%HTMLspecial;

Posted: Tue May 12, 2015 9:03 am
by Sergey Tkachenko
Implemented in TRichView 15.6 (available for registered users as a beta)