FirelyTeam / firely-net-sdk

The official Firely .NET SDK for HL7 FHIR
Other
829 stars 345 forks source link

XmlDomFhirNavigator error on navigating a Bundle.entry.resource #628

Closed cknaap closed 6 years ago

cknaap commented 6 years ago

If you run the unittest below on the attached xml file, it fails.

[BundleWithOneEntry.zip](https://github.com/ewoutkramer/fhir-net-api/files/2145746/BundleWithOneEntry.zip)

using FluentAssertions;
using Hl7.Fhir.Serialization;
using Hl7.FhirPath;
using System.IO;
using System.Linq;
using Xunit;

namespace Fhir.Net.Api.Tests
{
    public class BundleNavigationTests
    {
        [Fact]
        public void XmlBundleEntryNavigationFails()
        {
            var bundleXml = File.ReadAllText("BundleWithOneEntry.xml");
            var xmlNav = XmlDomFhirNavigator.Create(bundleXml);
            var entryNav = xmlNav.Select("entry.resource").First();
            var id = entryNav.Scalar("id");
            id.Should().NotBeNull();
        }
    }
}
ewoutkramer commented 6 years ago

This bug has been solved in branch "nav-based-serialization", which will be part of the next release!

ewoutkramer commented 6 years ago

Fixed by #646.