From: Alexander Larsson (alla@lysator.liu.se)
Date: Mon Feb 15 1999 - 12:12:06 EST
On 14 Feb, Daniel Veillard wrote:
>> Ok. So attribute values are whitespace ignorant... Is
>> multiple whitespace ignored in the content too?
>> (as in <string>a b c</string> vs <string>a b c</string>)
>
> No, element content is not !
> However when elements can contain both childs and text, then you may
> have troubles with white spaces.
> <string>a b c</string> will always be saved as read, but
> <string>a <elem>b</elem> c</string> may be saved differently.
> Being able to distinguish in such elements (mixed content) whether a
> white space is significant or not is difficult.
Ok, just so i don't make the same stupid mistake again: Exactly what
is guaranteed about element content (which is not mixed). What
characters do i need to escape?, which are significant and stored
exactly? (space? tab? newline?) Is it 8bit clean?
/ Alex, not very knowledgeable about xml.
Ps. This is the DTD i use in my program. Does it have any more obvious
blunders?
<!ELEMENT diagram (diagramdata, (layer)*) >
<!ELEMENT diagramdata (attribute)* >
<!ELEMENT layer (object | group)*>
<!ATTLIST layer
name CDATA #REQUIRED
visible (true|false) #REQUIRED >
<!ELEMENT object ((attribute)*, connections?)>
<!ATTLIST object
type CDATA #REQUIRED
version NMTOKEN #REQUIRED
id ID #REQUIRED >
<!ELEMENT connections (connection)*>
<!ELEMENT connection EMPTY>
<!ATTLIST connection
handle NMTOKEN #REQUIRED
to IDREF #REQUIRED
connection NMTOKEN #REQUIRED>
<!ELEMENT group (object | group)*>
<!ELEMENT attribute (composite | int | enum | real | boolean |
color | point | rectangle | string | font)*>
<!ATTLIST attribute name CDATA #REQUIRED >
<!ELEMENT composite (attribute)*>
<!ATTLIST composite type CDATA #IMPLIED>
<!ELEMENT int EMPTY>
<!ATTLIST int val NMTOKEN #REQUIRED>
<!ELEMENT enum EMPTY>
<!ATTLIST enum val NMTOKEN #REQUIRED>
<!ELEMENT real EMPTY>
<!ATTLIST real val CDATA #REQUIRED>
<!ELEMENT boolean EMPTY>
<!ATTLIST boolean val (true|false) #REQUIRED>
<!ELEMENT color EMPTY>
<!ATTLIST color val CDATA #REQUIRED>
<!ELEMENT point EMPTY>
<!ATTLIST point val CDATA #REQUIRED>
<!ELEMENT rectangle EMPTY>
<!ATTLIST rectangle val CDATA #REQUIRED>
<!ELEMENT string EMPTY>
<!ATTLIST string val CDATA #IMPLIED>
<!ELEMENT font EMPTY>
<!ATTLIST font name CDATA #REQUIRED>
---- Message from the list xml@rufus.w3.org Archived at : http://rufus.w3.org/veillard/XML/messages to unsubscribe: echo "unsubscribe xml" | mail majordomo@rufus.w3.org
This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:26 EDT