- c24c4cc: Fixes #60, preventing us from parsing documents that use other namespace prefixes than the ones used in the
xsi:type
definitions in the binding template.
- e89afa9: Add rudimentary support for content model variations through
xsi:type
. Check the README for details and #58 for the original issue.
- 50f84fc: Fix for a bug causing missing attribute values to be intepreted as empty strings. Workaround for a bug in the version of xmldom we're depending on. See #56.
- 1da2d3e: Prevent elements bound to missing objects from being inserted. Fixes #54.
- a9f8aac: Bump xmldom to version 0.6.0
- 6828baf: Prevent namespace declarations from getting dropped
-
f8ac631: Support for a simpler way to map arrays of non-object values.
Instead of binding as
array
, we're binding as values. Witharray
, every encounter of the element results in a new object getting added to the array. Withvalues
, we're not adding any values yet. However, if inside, we encounter something that is bound tovalue
, it will be added to the array as simple value.Perhaps this example makes it easier to grasp:
const template = parse( `<foo><bar c-bind="numbers|values">{{value|integer}}</bar></foo>` ); const data = template.fromXML(`<foo><bar>1</bar><bar>2</bar></foo>`); // { numbers: [ 1, 2 ] }
Instead of this:
const template = parse( `<foo><bar c-bind="numbers|array">{{value|integer}}</bar></foo>` ); const data = template.fromXML(`<foo><bar>1</bar><bar>2</bar></foo>`); // { numbers: [ { value: 1 }, { value: 2 } ] }
Note that we currently consider this feature to be unstable. You can use it, but be advised that the notation might change in the future.
-
88f9ea8: Drop pattern matching approach causing parsing issues
Before, there used to be a mechanism that would allow you to have the same element multiple times within the same template. Only if there would be an exact match with the elements attributes, it would be considered to be decoded based on whatever the template was suggesting.
<foo> <bar a="1">{first}</bar> <bar a="2">{second}</bar> </foo>
Given this template and a file like this:
<foo> <bar a="2">yay</bar> </foo>
… the resulting data object would be this:
{ "second": "yay" }
It turned out that this was actually causing parsing issues in case the XML serializer decided to introduce namespaces on an element that didn't have a namespace before. Since the mechanism was never in use — as far as I can tell — I decided to drop it.
- Fixing a bug that somehow reappeared.
- Add type definitions.
- Fixes an issue where container elements were getting inserted to aggressively in case of captures.
- Fixes a pattern matching bug causing some issues with namespaces. Note that this is related to an undocumented feature which might be dropped in a future major version.
- Fixes a bug where bindings on attributes are ignoring specific value types set on those attributes.
- Fix a number of issues with RelaxNG generation and namespaces.
- Add support for capturing an entire nodeset.
- Produce sensible RelaxNG grammars for captures.
- Fix a RelaxNG generation issue.
- Add CDATA support.
- Fixes a bug related to raw data.
- Have the ability to get the raw data, even if the fields have been annotated with type annotations.
- Fixes a RelaxNG generation bug caused by comment binding
- Comments used to offer a way to add more binding instructions to the template. That has now been replaced by the use of processing instructions.
- As a result, you can now bind comments to variables:
<!--{{foo}}-->
- Dropped
preserveWhitespace
, contemplating xml:space - Add the posibility to generate RelaxNG schemas from the template
- FIX: Falsy values were getting excluded from the output
- Upgrade xmldom dependency to ^0.3.0
- Added the
preserveWhitespace
option to do exactly that: preserve whitespace.
- Exposed the local name of the root element on the template.