From: Sven E. <sve...@we...> - 2001-10-15 06:09:10
|
"Sven Ehrke" <sve...@we...> schrieb am 14.10.01: > er...@go... schrieb am 14.10.01: > > OK, I'll try to implement that in the parser. BTW, is it > > allowed to have CDATA in the string value of attributes > > like that? > > Hmm, I just tried it with Netscape 6.1. It does accept them between > the element tags but not in the attributes. I'll try to find out more > about this tomorrow when I have to proper tools available. My big XML book says it's not allowed. I made up a small example (using XML authority, and XML Spy): ________________ DTD__________________ <?xml version='1.0' encoding='UTF-8' ?> <!--Generated by XML Authority--> <!ELEMENT e1 (#PCDATA)> <!ATTLIST e1 a1 CDATA #IMPLIED > _______________________________________ I was hoping that defining a1 as CDATA (character data) instead of PCDATA (parsed character data) would help but XML Spy says that the following XML document: ___________________________________________ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE e1 SYSTEM "D:\tmp\e1.dtd"> <e1 a1="<![CDATA[jjj]]>"><![CDATA[jjj]]></e1> ___________________________________________ is not even well formed. Using CDATA within the body of the elements (second CDATA in the example) is ok. Generally markup is not allowed for attributes. This might be another argument for rather using elements than attributes. So in summary I think at least some entities should be supported by an Eiffel XML parser and the CDATA as well for the elements. - Sven _______________________________________________________________________ 1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de Ih...@we..., 8MB Speicher, Verschluesselung - http://freemail.web.de |