none
BizTalk - XSLT not working RRS feed

  • Question

  • Input Schema :

    <?xml version="1.0" encoding="utf-16"
    ?>
    - <xs:schema
    xmlns
    ="http://P1.DetailLoop" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://P1.DetailLoop" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:annotation>
    - <xs:appinfo>
      <b:schemaInfo is_receipt="no" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
      </xs:appinfo>
      </xs:annotation>
    - <xs:element
    name
    ="DetailLoop">
    - <xs:complexType>
    - <xs:sequence>
    - <xs:element
    maxOccurs
    ="unbounded" name="LineItem">
    - <xs:complexType>
    - <xs:sequence>
      <xs:element name="PartNumber" type="xs:string"
    />
      <xs:element name="SubPartNumber" type="xs:string"
    />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>

    My XSLT:

    <

    ns0:TargetData>

      <

    xsl:for-eachselect="LineItem[generate-id(.)=generate-id(key('groups',PartNumber))]"/>



      <!--

    And let's do some sorting for good measure... -->

      <

    xsl:sortselect="PartNumber"order="ascending"/>

      <

    ItemInfo>

        <

    ItemNumber>

          <

    xsl:value-ofselect="PartNumber/text()"/>

        </

    ItemNumber>

        <

    SubItemInfo>

          <!--

    Another loop... -->

          <

    xsl:for-eachselect="key('groups',PartNumber)">

            <

    SubItemPart>

              <

    xsl:value-ofselect="SubPartNumber"/>

            </

    SubItemPart>

          </

    xsl:for-each>

        </

    SubItemInfo>

      </

    ItemInfo>



      </

    xsl:for-each>

    </

    ns0:TargetData>

    Receiving following error : I put my MAP validation to false

    what am I doing wrong ?


    MBH

    Friday, April 17, 2015 2:43 AM

All replies

  • it is complaining : Outout validation error - Root element missing.

    I checked my input file target namespace with schema,there are no spaces . Then why still it is failing ?


    MBH

    Friday, April 17, 2015 3:54 AM
  • Hi,

    Can you please provide the complete xslt for us to look in to the issue ? Are you using inline xslt? Your xslt looks incomplete and does not have the key declaration (<xsl:key name="groups" match="LineItem" use="PartNumber"/>) etc.

    Did you try to validate the map ? Did you get the same error ?

    Regards,

    Sajith C P


    Friday, April 17, 2015 6:35 AM
  • 1) I first added source and destination schematic, then went to map grid Validate map and steal that .xsl file and saved on my local and mentioned that in Map under Custom XSL code path. 2) Yes i called the key in other scripting function as XSLT call template, and used above logic in Inline XSLT. 3) Iam receiving same error : Output Validation error : Root element missing

    MBH

    Friday, April 17, 2015 10:57 AM
  • These posts are difficult to read.  If you use the Script Block set to Xml and past formatted Xml, it will make it much easier for everyone else to follow.

    Friday, April 17, 2015 11:35 AM
    Moderator
  • I used two scripting functoids as below, it always throwing Output validation error: Root element missing

    Inline XSLT Call Template :

    <xsl:key name="groups" match="LineItem" use="PartNumber"/>

    Inline XSLT :


    MBH

    Friday, April 17, 2015 12:09 PM
  • Did you debug the map using the debugger? 

    And why use xslt call template and don't set this xslt as the custom xslt in the BizTalk map?

    Friday, April 17, 2015 12:49 PM
  • what you mean Rex ?

    to put everything in Inline XSLT ?

    Yes, when I debug the map, its going to .xsl file and exiting....that debugging doesn't help much.


    MBH

    Friday, April 17, 2015 1:20 PM