Yorick Peterse
a2e5def263
Added headings + examples to the changelog.
2014-09-16 15:01:38 +02:00
Yorick Peterse
fb560429aa
Added SAX parsing to the list of parsing features.
2014-09-16 14:50:48 +02:00
Yorick Peterse
79d9ed3214
Corrected YARD argument name.
2014-09-16 14:50:17 +02:00
Yorick Peterse
2e5bb2ca09
Namespace YARD Rake tasks under "doc".
2014-09-16 14:49:49 +02:00
Yorick Peterse
ed6283ab7e
Updated the changelog.
2014-09-16 14:49:42 +02:00
Yorick Peterse
1c7d1e30b1
README example on using the SAX parser.
2014-09-16 14:36:02 +02:00
Yorick Peterse
317b49bcf6
Implemented a basic SAX API.
...
This API is a little bit dodgy (similar to Nokogiri's API) due to the use of
separate parser and handler classes. This is done to ensure that the return
values of callback methods (e.g. on_element) aren't used by Racc for building
AST trees. This also ensures that whatever variables are set by the handler
don't conflict with any variables of the parser.
This fixes #42 .
2014-09-16 14:30:46 +02:00
Yorick Peterse
9e935e5d24
Force the usage of the Racc Gem.
...
This ensures that we're loading the Gem and not the standard library version.
2014-09-16 11:58:56 +02:00
Yorick Peterse
cdfeeed85f
Provide somewhat more meaningful parser errors.
...
While still a bit cryptic this is probably as best as we can get it. An example:
Oga.parse_xml("<namefoo:bar=\"10\"")
parser.rb:116:in `on_error': Unexpected string on line 1: (Racc::ParseError)
=> 1: <namefoo:bar="10"
This fixes #43 .
2014-09-16 01:09:06 +02:00
Yorick Peterse
32b11ef1e2
self-close certain XML/HTML elements.
...
When an XML element has no child nodes a self-closing tag is used. When parsing
documents/elements in HTML mode this is only done if the element is a so called
"void element" (e.g. <link> tags).
This fixes #46 .
2014-09-16 00:44:38 +02:00
Yorick Peterse
6fc7e2e254
Track document types when parsing.
...
When parsing XML/HTML documents the corresponding document type (:html or :xml)
is stored in Document#type.
2014-09-16 00:25:51 +02:00
Yorick Peterse
bd322e8716
Rake tasks for building multi-platform Gems.
2014-09-15 22:18:28 +02:00
Yorick Peterse
9959f5cda4
Don't remove namespace attributes when registering
...
When registering namespaces from an attributes list the attributes should _not_
be removed.
This fixes #45 .
2014-09-15 22:04:03 +02:00
Yorick Peterse
795e669632
Ignore default NS when serializing elements.
...
When a default namespace is set (using xmlns="...") the method
XML::Element#to_xml should _not_ include the namespace prefix in the output.
2014-09-15 21:42:08 +02:00
Yorick Peterse
1abba1be9c
Don't overwrite namespace_name with "xmlns".
...
This was a leftover from an early prototype.
2014-09-15 21:38:53 +02:00
Yorick Peterse
41526e7013
Whitespace pedantics in Element#namespace.
2014-09-15 21:37:54 +02:00
Yorick Peterse
abbd8d6f84
Handle registering of default XML namespaces.
...
When the default namespace is registered (using xmlns="...") Oga now properly
sets the namespace of the container and all child elements.
This fixes #44 .
2014-09-15 21:36:15 +02:00
Yorick Peterse
ad2e040f05
Handle lexing of input such as just "</".
...
Previously this would cause the lexer to go in an infinite loop in the "text"
state machine.
This fixes #37 .
2014-09-15 17:20:06 +02:00
Yorick Peterse
b06eadc812
XPath support for absolute paths without tests.
...
This allows Oga to parse and evaluate the XPath expression "/". This expression
can be used to select just the root node/document.
This fixes #35 .
2014-09-15 17:06:58 +02:00
Yorick Peterse
398aaf68bc
Return a correct list of available namespaces.
...
This ensures that inner namespaces take precedence over outer namespaces.
Fixes #40 .
2014-09-14 18:42:02 +02:00
Yorick Peterse
96b6ef320b
Merge pull request #39 from ttasanen/fix_uc_void_tags
...
Ignore casing when testing for html void elements
2014-09-14 14:34:16 +02:00
Tero Tasanen
3c930433c4
Change Hash syntax to be consistent with other tests
2014-09-14 15:04:15 +03:00
Tero Tasanen
d0f48e0e3c
Added a lexer test case for uppercase void elements
2014-09-14 14:20:58 +03:00
Tero Tasanen
9c8dd60f92
Fix test cases
...
- Remove duplicate tests
- use parse_html helper
2014-09-14 14:14:51 +03:00
Tero Tasanen
9f71b1ec7b
Ignore casing when testing for html void elements
...
Fixes #36
2014-09-14 12:02:02 +03:00
Yorick Peterse
5019e0362c
Added checksum for 0.1.1 on JRuby.
2014-09-14 03:47:54 +02:00
Yorick Peterse
7db6732f14
Use proper Gem names for checksums.
...
This ensures that it also works for JRuby and the likes.
2014-09-14 03:47:35 +02:00
Yorick Peterse
77bcf2f17b
Generate stuff before building.
...
Kinda obvious.
2014-09-14 03:45:33 +02:00
Yorick Peterse
ee538ddcc2
Merge pull request #34 from ttasanen/fix_comment
...
Fix function name in comment
2014-09-13 16:22:55 +02:00
Tero Tasanen
5979798356
Fix function name in comment
2014-09-13 16:22:06 +03:00
Yorick Peterse
d082822cdc
Removed the node_type method crap.
...
The logic this was used for now only resides in the pull parser, instead of
being exposed to the public.
This fixes #30 .
2014-09-13 15:09:52 +02:00
Yorick Peterse
9ab5c302f7
Release 0.1.1.
2014-09-13 11:50:30 +02:00
Yorick Peterse
b8a82b2094
Separate XML attributes by spaces.
...
This was originally reported by @jrochkind and partially patched by @billdueber.
My patches are built upon the latter, but without the need of using Array#map,
Array#join, etc. They also contain a few style changes.
This fixes #32 and #33 .
2014-09-13 11:47:06 +02:00
Yorick Peterse
dd47dd43a0
Example on querying XML namespaces.
2014-09-12 16:54:36 +02:00
Yorick Peterse
9d798ce7b9
Added XML namespaces to the features list.
2014-09-12 16:50:12 +02:00
Yorick Peterse
27d877ccce
Updated the Gem description.
2014-09-12 14:40:01 +02:00
Yorick Peterse
ddc6eb4819
Release 0.1.0.
2014-09-11 23:41:46 +02:00
Yorick Peterse
7a3655a43b
Updated README intro + thread-safety section.
2014-09-11 23:39:10 +02:00
Yorick Peterse
019ba8c660
Set the initial version to 0.1.0.
2014-09-11 14:11:24 +02:00
Yorick Peterse
319d622fa5
Include namespaces when converting attrs to XML.
2014-09-11 14:03:04 +02:00
Yorick Peterse
32a7abd8c2
Corrected line about what kind of parser I want.
2014-09-11 01:12:18 +02:00
Yorick Peterse
ad4850dfbd
Corrected the contributing YARD link.
2014-09-11 00:13:44 +02:00
Yorick Peterse
9406a8651e
Documentation chapter in the README.
2014-09-11 00:11:06 +02:00
Yorick Peterse
5ff7f39f08
Rake task for uploading documentation.
2014-09-11 00:10:58 +02:00
Yorick Peterse
0c61749c65
Added basic Nokogiri migration guide.
...
I will expand this over time, but it's a decent start for the time being.
This fixes #13 .
2014-09-11 00:01:44 +02:00
Yorick Peterse
c45d32a37e
Methods for adding attributes to elements.
...
The methods XML::Element#add_attribute and XML::Element#set can be used to more
easily add attributes to elements. The first method simply adds an Attribute
instance and links it to the element. This allows for fine grained control over
what data the attribute should contain. The second method ("set") simply sets an
attribute based on a name and value, optionally creating the attribute if it
doesn't already exist.
2014-09-10 23:55:29 +02:00
Yorick Peterse
6cb2d54875
Added XML::Element#inner_text=
...
This method can be used to more easily set the text of an element, without
having to manually muck around with XML::Text instances.
2014-09-10 23:25:39 +02:00
Yorick Peterse
cfbdf1bdb1
Removed YARD crap from Markdown files.
2014-09-10 22:46:58 +02:00
Yorick Peterse
98cd54685d
Updated the Rubies to run Travis on.
2014-09-10 22:17:04 +02:00
Yorick Peterse
6d19c9b311
Added XML::Element#get
...
This method can be used to directly retrieve an attribute value.
2014-09-10 19:03:32 +02:00