Skip to content

Commit

Permalink
* Fixed #CONREF in elements with declared content
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Wielemaker committed Sep 27, 2002
1 parent eb7946d commit 78108d7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* FIXED: #CONREF attribute handling in elements with declared content
(CDATA/RCDATA). Richard O'Keefe.

SWI-Prolog VERSION 5.0.10
=========================

* FIXED: properly handle elements that have only an <!ATTLIST declaration
but no <!ELEMENT declaration. (C. M. Sperberg-McQueen).

Expand All @@ -17,7 +23,7 @@
for providing a clear description how to handle this.

SWI-Prolog VERSION 5.0.9
=========================
========================

* FIXED: correct handling of content_length(Len) option (was reading one
character too many). Oops, normal reading was broken. Fixed.
Expand Down
10 changes: 10 additions & 0 deletions Test/conref2.sgml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE conref [
<!ELEMENT conref O O (b+)>
<!ELEMENT b - O RCDATA>
<!ATTLIST b x CDATA #CONREF>
]>
<b>1.</b>
<b x=2>
<b>3.</b>
<b x=4>
<b>5.</b>
2 changes: 2 additions & 0 deletions Test/ok/conref2.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[element(conref, [], [element(b, [], ['1.']), element(b, [x='2'], []), element(b, [], ['3.']), element(b, [x='4'], []), element(b, [], ['5.'])])].
[].
2 changes: 2 additions & 0 deletions parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -3344,6 +3344,8 @@ process_begin_element(dtd_parser *p, const ichar *decl)
if ( p->empty_element )
{ p->empty_element = NULL;
close_element(p, e, conref);
if ( conref ) /* might be S_CDATA due to declared content */
p->cdata_state = p->state = S_PCDATA;
}

return TRUE;
Expand Down

0 comments on commit 78108d7

Please sign in to comment.