Skip to content

Encoding issue: StringStream over XmlDocument.OuterXml feeds invalid XML to XslCompiledTransfrom #1

Description

@icraftsoftware

The following test code illustrates the issue

[Fact]
public void ValidateTransform()
{
  var templateTargetEnvelope = EnvelopeFactory.Create<Envelope>();
  var templateTargetEnvelopeStream = new StringStream(templateTargetEnvelope.OuterXml);

  var batchContentWithParts = MessageBodyFactory.Create<Batch.Content>(MessageBody.Samples.LoadString("Message.BatchContent.xml"));
  var batchContentWithPartsStream = new StringStream(batchContentWithParts.OuterXml);
  
  Given(
      input => input
        .Message(templateTargetEnvelopeStream)
        .Message(batchContentWithPartsStream))
    .Transform
    .OutputsXml(
      output => output
        .ConformingTo<Envelope>()
        .ConformingTo<Batch.Release>()
        .WithStrictConformanceLevel())
    .Validate();
}

and produces the following exception System.Xml.XmlException Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position 40..

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions