Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/xmllite/reader.c | 96 +++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c index 701dd9cc31..88db0df4c2 100644 --- a/dlls/xmllite/reader.c +++ b/dlls/xmllite/reader.c @@ -1846,54 +1846,6 @@ static HRESULT reader_parse_externalid(xmlreader *reader) return S_FALSE; }
-/* [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' */ -static HRESULT reader_parse_dtd(xmlreader *reader) -{ - static const WCHAR doctypeW[] = {'<','!','D','O','C','T','Y','P','E',0}; - strval name; - WCHAR *cur; - HRESULT hr; - - /* check if we have "<!DOCTYPE" */ - if (reader_cmp(reader, doctypeW)) return S_FALSE; - reader_shrink(reader); - - /* DTD processing is not allowed by default */ - if (reader->dtdmode == DtdProcessing_Prohibit) return WC_E_DTDPROHIBITED; - - reader_skipn(reader, 9); - if (!reader_skipspaces(reader)) return WC_E_WHITESPACE; - - /* name */ - hr = reader_parse_name(reader, &name); - if (FAILED(hr)) return WC_E_DECLDOCTYPE; - - reader_skipspaces(reader); - - hr = reader_parse_externalid(reader); - if (FAILED(hr)) return hr; - - reader_skipspaces(reader); - - cur = reader_get_ptr(reader); - if (*cur != '>') - { - FIXME("internal subset parsing not implemented\n"); - return E_NOTIMPL; - } - - /* skip '>' */ - reader_skipn(reader, 1); - - reader->nodetype = XmlNodeType_DocumentType; - reader_free_strvalued(reader, &reader->empty_element.localname); - reader_strvaldup(reader, &name, &reader->empty_element.localname); - reader_free_strvalued(reader, &reader->empty_element.qname); - reader_strvaldup(reader, &name, &reader->empty_element.qname); - - return S_OK; -} - /* [11 NS] LocalPart ::= NCName */ static HRESULT reader_parse_local(xmlreader *reader, strval *local, BOOL check_for_separator) { @@ -2009,6 +1961,54 @@ static HRESULT reader_parse_qname(xmlreader *reader, strval *prefix, strval *loc return S_OK; }
+/* [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' */ +static HRESULT reader_parse_dtd(xmlreader *reader) +{ + static const WCHAR doctypeW[] = {'<','!','D','O','C','T','Y','P','E',0}; + strval name; + WCHAR *cur; + HRESULT hr; + + /* check if we have "<!DOCTYPE" */ + if (reader_cmp(reader, doctypeW)) return S_FALSE; + reader_shrink(reader); + + /* DTD processing is not allowed by default */ + if (reader->dtdmode == DtdProcessing_Prohibit) return WC_E_DTDPROHIBITED; + + reader_skipn(reader, 9); + if (!reader_skipspaces(reader)) return WC_E_WHITESPACE; + + /* name */ + hr = reader_parse_name(reader, &name); + if (FAILED(hr)) return WC_E_DECLDOCTYPE; + + reader_skipspaces(reader); + + hr = reader_parse_externalid(reader); + if (FAILED(hr)) return hr; + + reader_skipspaces(reader); + + cur = reader_get_ptr(reader); + if (*cur != '>') + { + FIXME("internal subset parsing not implemented\n"); + return E_NOTIMPL; + } + + /* skip '>' */ + reader_skipn(reader, 1); + + reader->nodetype = XmlNodeType_DocumentType; + reader_free_strvalued(reader, &reader->empty_element.localname); + reader_strvaldup(reader, &name, &reader->empty_element.localname); + reader_free_strvalued(reader, &reader->empty_element.qname); + reader_strvaldup(reader, &name, &reader->empty_element.qname); + + return S_OK; +} + static WCHAR get_predefined_entity(const xmlreader *reader, const strval *name) { static const WCHAR entltW[] = {'l','t'};