Map produces invalid XML

Home Page Forums BizTalk 2004 – BizTalk 2010 Map produces invalid XML

Viewing 1 reply thread
  • Author
    Posts
    • #14519

      I have a problem with a map creating an inavlid xml message.

      In the properties of the map, I have specified the values for the Doctype Public and Doctype System properties and I have specified No for the Omit XML Declaration property.

      When I specify all 3 of these properties, the resulting message is created without the root node. All of the other elements are present, but the root node is missing. The following shape in the orchestration then complains about an invalid message.

      Has anyone else encountered this problem? Could this possibly be a bug in BizTalk?

      Thanks,
      Brett

    • #14520

      Here is the XSLT Output:

      <?xml version=\”1.0\” encoding=\”UTF-16\”?>
      <xsl:stylesheet xmlns:xsl=\”http://www.w3.org/1999/XSL/Transform\” xmlns:msxsl=\”urn:schemas-microsoft-com:xslt\” xmlns:var=\”http://schemas.microsoft.com/BizTalk/2003/var\” exclude-result-prefixes=\”msxsl var s0\” version=\”1.0\” xmlns:ns0=\”http://MappingProblem.Schema2\” xmlns:s0=\”http://MappingProblem.Schema1\”>
      <xsl:output omit-xml-declaration=\”no\” method=\”xml\” version=\”1.0\” doctype-public=\”-//Bibit//DTD Bibit PaymentService v1//EN\” doctype-system=\”http://dtd.bibit.com/paymentService_v1.dtd\” />
      <xsl:template match=\”/\”>
      <xsl:apply-templates select=\”/s0:Schema1\” />
      </xsl:template>
      <xsl:template match=\”/s0:Schema1\”>
      <ns0:Schema2>
      <FullName>
      <xsl:value-of select=\”FirstName/text()\” />
      </FullName>
      </ns0:Schema2>
      </xsl:template>
      </xsl:stylesheet>

      Here is the output from Test Map:

      <?xml version=\”1.0\” encoding=\”utf-8\”?>
      <!DOCTYPE ns0:Schema2 PUBLIC \”-//Bibit//DTD Bibit PaymentService v1//EN\” \”http://dtd.bibit.com/paymentService_v1.dtd\”>
      <ns0:Schema2 xmlns:ns0=\”http://MappingProblem.Schema2\”>
      <FullName>FirstName_0</FullName>
      </ns0:Schema2>

      The error I get is as follows:

      Map2_output.xml: error btm1046: Output validation error: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method.

      The output from Test Map looks correct. The output I get when I run it in an Orchestration is as follows (note there is no Schema2 element):

      <?xml version=\”1.0\” encoding=\”UTF-8\” standalone=\”no\”?>
      <!DOCTYPE ns0:Schema2 PUBLIC \”-//Bibit//DTD Bibit PaymentService v1//EN\” \”http://dtd.bibit.com/paymentService_v1.dtd\”[]>
      <FullName>FirstName_0</FullName>

      Thanks,
      Brett

      • #14521

        Have raised this issue with Microsoft. They have acknoweledged it is a problem and are investigating.

        • #14522

          Can you post the following:
          The XSLT output from the map: Validate Map and copy and paste XSLT output.

          The output from Test Map (set Output Validation = false on map file properties)

          The error you are getting from Test Map with Output Validation = true

          • #14523

            Interesting problem.

            The map works in Biztalk Mapper test mode – apart from the minor security issue in the output validation step. Biztalk does not perform a validate after a transform at runtime

            I also tested it using XslCompiledTransform in a C# program and it works.

            I would report this as a bug.

            One potential work around would be to implement the XslTransform pipeline component from the SDK and perform the transform in the send pipeline

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.