- #112: Added a
mixedContent
deserializer function, which might be useful if you're parsing HTML-like documents with elements that contain both text and other elements as siblings. (@staabm).
- Now requires PHP 7.
- Uses typehints everywhere.
- Fixed some minor strict typing-related issues.
- Removed workaround for PHP bug 64230.
- Now requires PHP 5.5.
- Using
finally
to always roll back the context stack when serializing. - #94: Fixed an infinite loop condition when reading some invalid XML documents.
- The
contextStack
in the Reader object is now correctly rolled back in error conditions (@staabm). - repeatingElements deserializer now still parses if a bare element name without clark notation was given.
$elementMap
in the Reader now also supports bare element names.Service::expect()
can now also work with bare element names.
- Parsing clark-notation is now cached. This can speed up parsing large documents with lots of repeating elements a fair bit. (@icewind1991).
- Any array thrown into the serializer with numeric keys is now simply traversed and each individual item is serialized. This fixes an issue related to serializing value objects with array children.
- When serializing value objects, properties that have a null value or an empty array are now skipped. We believe this to be the saner default, but does constitute a BC break for those depending on this.
- Serializing array properties in value objects was broken.
- The
Service
class adds a newmapValueObject
method which provides basic capabilities to map between ValueObjects and XML. - #61: You can now specify serializers for specific classes, allowing you
separate the object you want to serialize from the serializer. This uses the
$classMap
property which is defined on both theService
andWriter
. - It's now possible to pass an array of possible root elements to
Sabre\Xml\Service::expect()
. - Moved some parsing logic to
Reader::getDeserializerForElementName()
, so people with more advanced use-cases can implement their own logic there. - #63: When serializing elements using arrays, the
value
key in the array is now optional. - #62: Added a
keyValue
deserializer function. This can be used instead of theElement\KeyValue
class and is a lot more flexible. (@staabm) - Also added an
enum
deserializer function to replaceElement\Elements
. - Using an empty string for a namespace prefix now has the same effect as
null
.
- #53: Added
parseGetElements
, a function likeparseInnerTree
, except that it always returns an array of elements, or an empty array.
- #44, #45: Catching broken and invalid XML better and throwing
Sabre\Xml\LibXMLException
whenever we encounter errors. (@stefanmajoor, @DaanBiesterbos)
- No functional changes since 0.4.3. Marking it as 1.0.0 as a promise for API stability.
- Using php-cs-fixer for automated CS enforcement.
- Minor tweaks for the public release.
- Removed
constants.php
again. They messed with PHPUnit and don't really provide a great benefit. - #41: Correctly handle self-closing xml elements.
- #40: An element with an empty namespace (xmlns="") is not allowed to have a prefix. This is now fixed.
- Added
Sabre\Xml\Service
. This is intended as a simple way to centrally configure xml applications and easily parse/write things from there. #35, #38. - Renamed 'baseUri' to 'contextUri' everywhere.
- #36: Added a few convenience constants to
lib/constants.php
. Sabre\Xml\Util::parseClarkNotation
is now in theSabre\Xml\Service
class.
- Added
XmlDeserializable
to matchXmlSerializable
.
- Added
$elementMap
argument to parseInnerTree, for quickly overriding parsing rules within an element.
- Now depends on sabre/uri 1.0.
- LibXMLException now inherits from ParseException, so it's easy for users to catch any exception thrown by the parser.
- Major BC Break: method names for the Element interface have been renamed
from
serializeXml
anddeserializeXml
toxmlSerialize
andxmlDeserialize
. This is so that it matches PHP'sJsonSerializable
interface. - #25: Added
XmlSerializable
to allow people to write serializers without having to implement a deserializer in the same class. - #26: Renamed the
Sabre\XML
namespace toSabre\Xml
. Due to composer magic and the fact that PHP namespace are case-insensitive, this should not affect anyone, unless you are doing exact string matches on class names. - #23: It's not possible to automatically extract or serialize Xml fragments
from documents using
Sabre\Xml\Element\XmlFragment
.
- #16: Added ability to override
elementMap
,namespaceMap
andbaseUri
for a fragment of a document during reading an writing usingpushContext
andpopContext
. - Removed:
Writer::$context
andReader::$context
. - #15: Added
Reader::$baseUri
to matchWriter::$baseUri
. - #20: Allow callbacks to be used instead of
Element
classes in theReader
. - #25: Added
readText
to quickly grab all text from a node and advance the reader to the next node. - #15: Added
Sabre\XML\Element\Uri
.
- Added:
CData
element. - #13: Better support for xml with no namespaces. (@kalmas)
- Switched to PSR-4 directory structure.
- Added: baseUri property to the Writer class.
- Added: The writeElement method can now write complex elements.
- Added: Throwing exception when invalid objects are written.
- Fixed: The KeyValue parser was skipping over elements when there was no whitespace between them.
- Fixed: Clearing libxml errors after parsing.
- Added: Support for CDATA.
- Added: Context properties.
- Changed: Reader::parse returns an array with 1 level less depth.
- Added: A LibXMLException is now thrown if the XMLReader comes across an error.
- Fixed: Both the Elements and KeyValue parsers had severe issues with nesting.
- Fixed: The reader now detects when the end of the document is hit before it should (because we're still parsing an element).
- Added: Elements parser.
- Added: KeyValue parser.
- Change: Reader::parseSubTree is now named parseInnerTree, and returns either a string (in case of a text-node), or an array (in case there were child elements).
- Added: Reader::parseCurrentElement is now public.
- First alpha release
Project started: 2012-11-13. First experiments in June 2009.