| 7104 | } |
| 7105 | |
| 7106 | ldomDocument * LVParseHTMLStream( LVStreamRef stream, |
| 7107 | const elem_def_t * elem_table, |
| 7108 | const attr_def_t * attr_table, |
| 7109 | const ns_def_t * ns_table ) |
| 7110 | { |
| 7111 | if ( stream.isNull() ) |
| 7112 | return NULL; |
| 7113 | bool error = true; |
| 7114 | ldomDocument * doc; |
| 7115 | doc = new ldomDocument(); |
| 7116 | doc->setDocFlags( 0 ); |
| 7117 | |
| 7118 | ldomDocumentWriterFilter writerFilter(doc, false, HTML_AUTOCLOSE_TABLE); |
| 7119 | doc->setNodeTypes( elem_table ); |
| 7120 | doc->setAttributeTypes( attr_table ); |
| 7121 | doc->setNameSpaceTypes( ns_table ); |
| 7122 | |
| 7123 | /// FB2 format |
| 7124 | LVFileFormatParser * parser = new LVHTMLParser(stream, &writerFilter); |
| 7125 | if ( parser->CheckFormat() ) { |
| 7126 | if ( parser->Parse() ) { |
| 7127 | error = false; |
| 7128 | } |
| 7129 | } |
| 7130 | delete parser; |
| 7131 | if ( error ) { |
| 7132 | delete doc; |
| 7133 | doc = NULL; |
| 7134 | } |
| 7135 | return doc; |
| 7136 | } |
| 7137 | |
| 7138 | #if 0 |
| 7139 | static lString16 escapeDocPath( lString16 path ) |
no test coverage detected