Jonas Fonseca
021af4e87c
Although aware ELinks doesn't need another sgml/doctype here is DocBook
...
It was created a long time ago so (I think) it deserves to survive. It
maps .sgml files to applicatino/docbook+xml and uses the highlighter.
2006-01-01 23:22:10 +01:00
Jonas Fonseca
6b62e0cb77
Declare struct sgml_parser_state above struct sgml_parser
...
... and describe the info member.
2005-12-31 20:02:39 +01:00
Jonas Fonseca
f0148c2ecf
Keep struct sgml_parsing_state private to the parser
2005-12-31 19:59:11 +01:00
Jonas Fonseca
4a766f350b
Just for fun also parse <?xml-stylesheet attributes
2005-12-31 03:13:39 +01:00
Jonas Fonseca
a578ed4667
Make the SGML scanner (optionally) keep track of line numbers
...
A new line is either \n or \f. The main logic for counting lines is in
skip_sgml{,_chars,_space}. For the general case where line numbers are not
wanted the code tries to avoid the extra checks for newlines.
This will be useful for reporting errors when loading the XBEL file.
2005-12-31 02:46:56 +01:00
Jonas Fonseca
b23beed031
Rename skip_comment() and skip_cdata_section() to conform to skip_sgml_*()
2005-12-31 02:00:09 +01:00
Jonas Fonseca
0891cda51e
Introduce skip_sgml_space() that wraps scan_sgml(..., SGML_SCAN_WHITESPACE)
2005-12-31 01:57:54 +01:00
Jonas Fonseca
9264221635
Make init_dom_scanner() take the state arg and drop a macro
2005-12-31 01:55:38 +01:00
Jonas Fonseca
7489c134f7
Make non-terminated comments and cdata sections have 'the rest' as content
2005-12-31 01:47:57 +01:00
Jonas Fonseca
8f7f6abc16
Use skip_sgml_chars() in skip_comment() and skip_cdata_section()
2005-12-31 01:40:52 +01:00
Jonas Fonseca
4e10bcf772
Drop useless code for proc. instruction scanning
2005-12-31 01:18:49 +01:00
Jonas Fonseca
e8ff8bd5f0
Fix another off-by-one error similar to the SGML comment parsing
2005-12-31 01:14:52 +01:00
Jonas Fonseca
ab7ba39d42
Introduce skip_sgml_chars() to avoid usage of memchr()
2005-12-31 00:06:12 +01:00
Jonas Fonseca
14a3f9c0fd
Disable dom-select building since it requires defining of DOM_STACK_TRACE
2005-12-31 00:05:49 +01:00
Jonas Fonseca
9a0bf83756
Add basic stuff for XBEL parsing/highlighting using the DOM engine
2005-12-30 22:19:32 +01:00
Jonas Fonseca
aa07b3edf4
Fix old (non) problem with using VERSION identifier by #undef'ing it first
2005-12-30 22:13:13 +01:00
Jonas Fonseca
65a114f4bc
Sort the RSS elements, they are supposed to be binarily searchable
2005-12-30 21:46:44 +01:00
Jonas Fonseca
ad052c3985
Hey, hey Cripple Creek Fai^H^Herry
2005-12-30 21:19:46 +01:00
Jonas Fonseca
41f1f5f9d3
Add a simple program for testing the DOM select code
...
It accepts --uri, --src and --selector args.
2005-12-30 03:33:48 +01:00
Jonas Fonseca
4f09ac99f7
Make it possible to identify the output of DOM stack tracers
2005-12-30 03:29:17 +01:00
Jonas Fonseca
0ddb5f2d18
Use the DOM stack tracer for getting a dump of active nodes
2005-12-30 03:02:59 +01:00
Jonas Fonseca
bd1beb1fab
Use the stack when creating the select node hierachy
2005-12-30 02:59:34 +01:00
Jonas Fonseca
4868c23a06
Cleanup the DOM test Makefile so it's more generic and more silent
2005-12-30 02:19:25 +01:00
Jonas Fonseca
76a524ddf6
More <?xml and comment tests, fix an off-by-one error for comments skipping
2005-12-29 22:26:39 +01:00
Jonas Fonseca
bd877570d2
Test some more obscure proc. instructions and fix some assertion failures
2005-12-29 21:52:27 +01:00
Jonas Fonseca
57168e1fbc
Handle <element path=/to/%61-&\one";files/> as a self-closing tag
...
Before the '/' before '>' would be interpreted as part of the attribute
value. Hope this is sensible slurping of the markup soup.
2005-12-29 20:38:43 +01:00
Jonas Fonseca
958a4a1b51
Add tests for more things like space handling and obscure formatting
2005-12-29 19:13:48 +01:00
Jonas Fonseca
beb8337fc5
Add rule to make test run from src/dom dir
2005-12-29 18:33:59 +01:00
Jonas Fonseca
1a177491a0
Fix SGML parsing of processing instructions (<?xml ...?>)
...
It involves adding a new scanner state which is used only to generate a new
processing instruction (PI) data token. This removes some scanner specific
code from the parser and makes handling of PIs more generic. The data of
XML PIs are still parsed as attributes and added to the PI node.
The 6th test now succeeds. Hurrah!
2005-12-29 18:31:49 +01:00
Jonas Fonseca
c24c67ce59
Make it possible to initialise a scanner in a specific state
2005-12-29 18:20:03 +01:00
Jonas Fonseca
889a0f16f8
Fix the expected output of processing instruction parsing
...
Spaces after the target should be skipped.
2005-12-29 18:00:26 +01:00
Jonas Fonseca
ba5dbd3a18
Add test_output_equals helper and add a few more tests
...
The last one fails for now. Incorrect parsing of processing instructions.
2005-12-29 06:54:41 +01:00
Jonas Fonseca
23f21f1924
Fine tune how some of the nodes are printed, fix string compressing
2005-12-29 06:50:51 +01:00
Jonas Fonseca
602d2d8a66
Add README for the test infrastructure mostly pasted from git/t/README
2005-12-29 05:12:36 +01:00
Jonas Fonseca
d394cb0bc1
Grab GITs shell script-based test infrastructure and add "Hello world" test
2005-12-29 04:44:03 +01:00
Jonas Fonseca
f42b39ee3c
Fix indentation so that things are printed at the start of the line
2005-12-29 04:39:20 +01:00
Jonas Fonseca
8dcbaa76f3
sgml-parser: Make it possible to specify the URL and the source to parse
2005-12-29 04:29:13 +01:00
Jonas Fonseca
c475f1fc0c
Drop linking with util/string.o, since memdebug no longer requires it
2005-12-28 23:07:06 +01:00
Jonas Fonseca
4feba6d515
Use stdio when printing enhanced values instead of allocating first
2005-12-28 23:02:45 +01:00
Jonas Fonseca
4bbc25c532
Remove dependency on util/string.h from dom/string.h
2005-12-28 21:20:55 +01:00
Jonas Fonseca
9bd346c295
dom_scanner_token_contains(): Use strcasecmp() instead of strlcasecmp()
2005-12-28 21:18:08 +01:00
Jonas Fonseca
fb6ca9a390
Use dom_string for storing the name member of dom_scanner_string_mapping
2005-12-28 21:10:05 +01:00
Jonas Fonseca
f1015f8a6a
Make files include dom/string.h instead of util/string.h directly
2005-12-28 20:45:55 +01:00
Jonas Fonseca
e34d0d3de4
Initialize the string->length in init_dom_string()
2005-12-28 19:49:22 +01:00
Jonas Fonseca
1b71368459
Add proof-of-concept stand-alone test binary which just prints Hello World
...
May it multiply in great numbers and help to stabilize the DOM
implementation.
2005-12-28 17:10:01 +01:00
Jonas Fonseca
1bd0c8758e
Make the DOM node creators take dom_string structs
2005-12-28 16:47:28 +01:00
Jonas Fonseca
ec7b293e4e
Some minor cleanup of token string access
2005-12-28 16:34:42 +01:00
Jonas Fonseca
6e163b186c
Make the dom_scanner_token store it's string in a dom_string struct
2005-12-28 16:23:36 +01:00
Jonas Fonseca
97c702c674
Make init_dom_select() take dom_string struct
2005-12-28 15:57:37 +01:00
Jonas Fonseca
2e4e404145
Make init_dom_scanner() take the source string as a dom_string struct
2005-12-28 15:55:21 +01:00
Jonas Fonseca
62d981c551
Store struct dom_scan_table_info data in a dom_string
2005-12-28 15:51:31 +01:00
Jonas Fonseca
73785bee02
Remove some unneeded #includes
2005-12-28 15:36:58 +01:00
Jonas Fonseca
dbf0948062
Do not decode entity references and fix the tree tracer for document nodes
...
The idea is to make the DOM thing not depend on too many external things.
2005-12-28 15:27:05 +01:00
Jonas Fonseca
d1e275be52
Make parse_sgml() take buffer as dom_string struct
2005-12-28 15:21:45 +01:00
Jonas Fonseca
11e168aba4
Make init_sgml_parser() take URI as dom_string struct
2005-12-28 15:19:10 +01:00
Jonas Fonseca
71533eef9a
Elute all DOM-related code and put it in src/dom
2005-12-28 14:05:14 +01:00