Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8217619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:31:15+00:00 2026-06-07T12:31:15+00:00

I have a very complex input message whose node names and values I need

  • 0

I have a very complex input message whose node names and values I need to regurgitate (without any namespace info) to the output as though viewing the document in a browser using an XSL stylesheet. I do not need to map any of the individual source XML elements to corresponding target elements. The output will be passed to a flat-file assembler and sent as a simple text message to the consumer.

For simplicity I removed most of the namespaces and changed prefixes in this stylesheet which produces exactly the output I desire:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:abcd="http://abcd.whatever.net/abcd/1.0.1" xmlns:info="http://info.sumthin.net/1.0.0" xmlns:wxyz="http://wxyz.widgetwonks.net/wxyz/3.0.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<xsl:output method="text" />

<xsl:template match="abcd:Message">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="info:SpecialText">
    <xsl:text> </xsl:text>
    <xsl:value-of select="."/>
    <xsl:text>&#010;</xsl:text>
</xsl:template>

<xsl:template match="wxyz:PersonSSN">
    <xsl:text> SSN: </xsl:text>
    <xsl:value-of select="substring(., 0, 4)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(., 4, 2)"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="substring(., 6, 4)"/>
    <xsl:text>&#010;</xsl:text>
</xsl:template>

<xsl:template match="*">
    <xsl:if test="string-length(normalize-space(text()))=0">
        <xsl:text>&#010;</xsl:text>
        <xsl:value-of select="local-name()"/>
    <xsl:text>&#010;</xsl:text>
    </xsl:if>

    <xsl:if test="not(string-length(normalize-space(text()))=0)">
        <xsl:text> </xsl:text>
        <xsl:value-of select="local-name()"/>: <xsl:value-of select="normalize-space(text())"/>
    </xsl:if>
    <xsl:apply-templates/>
</xsl:template>

<xsl:template match="text()|@*">
    <xsl:if test="string-length(normalize-space(.)) != 0">
        <xsl:text>&#010;</xsl:text>
    </xsl:if>
</xsl:template>

</xsl:stylesheet>

In BizTalk I have referenced this stylesheet on my map grid’s “Custom XSL Path” property, and when I test the map I get the right output.

But how can I map this output to a target schema? The output of the stylesheet is just a very long stream of text with many x0D x0A (cr / lf) sprinkled in. I have not been able to devise a schema that BizTalk will permit to be a receptacle for the stylesheet output.

-Mark

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:31:16+00:00Added an answer on June 7, 2026 at 12:31 pm

    I finally resolved my own question, as follows.

    Developed the following XSL stylesheet to transform the input message to a normal XML document:

    <?xml version="1.0" encoding="utf-8"?>
    <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 ScriptNS0" version="1.0" xmlns:s0="http://abcd.whatever.net/abcd/1.0.1" xmlns:ScriptNS0="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0" xmlns:info="http://info.sumthin.net/1.0.0" xmlns:wxyz="http://wxyz.widgetwonks.net/wxyz/3.0.3">
    
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    
    <xsl:template match="/">
        <Message>
            <xsl:apply-templates />
        </Message>
    </xsl:template>
    <!-- <xsl:template match="/s0:Message" /> -->
    <xsl:template match="info:CaveatText">
        <xsl:element name="TextField">
            <xsl:text>  </xsl:text>
            <xsl:value-of select="."/>
            <xsl:text>&#010;</xsl:text>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="wxyz:PersonSSNID/wxyz:ID">
        <xsl:element name="TextField">
            <xsl:text>    SSN: </xsl:text>
            <xsl:value-of select="substring(., 0, 4)"/>
            <xsl:text>-</xsl:text>
            <xsl:value-of select="substring(., 4, 2)"/>
            <xsl:text>-</xsl:text>
            <xsl:value-of select="substring(., 6, 4)"/>
            <xsl:text>&#010;</xsl:text>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*">
        <xsl:if test="string-length(normalize-space(text()))=0">
            <xsl:element name="TextField">
                <xsl:text>&#010;</xsl:text>
                <xsl:value-of select="local-name()"/>
                <xsl:text>&#010;</xsl:text>
            </xsl:element>
        </xsl:if>
    
        <xsl:if test="not(string-length(normalize-space(text()))=0)">
            <xsl:element name="TextField">
                <xsl:text>    </xsl:text>
                <xsl:value-of select="local-name()"/>: <xsl:value-of select="normalize-space(text())"/>
            </xsl:element>
        </xsl:if>
        <xsl:apply-templates/>
    </xsl:template>
    
    <xsl:template match="text()|@*">
        <xsl:if test="string-length(normalize-space(.)) != 0">
            <xsl:element name="TextField">
                <xsl:text>&#010;</xsl:text>
            </xsl:element>
        </xsl:if>
    </xsl:template>
    

    A sample XML document created by the stylesheet looks like this in a text editor:

    <Message xmlns:{namespaces galore...}><TextField>
    Message
    </TextField><TextField>
    HeaderArea
    </TextField><TextField>    KeyText: PQ</TextField><TextField>
    </TextField><TextField>    HeaderText: XYXY1010Z</TextField><TextField>
    </TextField><TextField>
    ResponseDataSection
    </TextField><TextField>  **TEST**THIS RESPONSE IS FROM ABCD TEST SYSTEM.
    </TextField><TextField>
    PersonName
    </TextField><TextField>    PersonGivenName: JACK</TextField><TextField>
    </TextField><TextField>    PersonMiddleName: DANIEL</TextField><TextField>
    </TextField><TextField>    PersonSurName: WEBBER</TextField><TextField>
    </TextField><TextField>    PersonBirthDateText: 1975-01-31</TextField><TextField>
    </TextField><TextField>
    PersonAssignedIDDetails
    </TextField><TextField>
    PersonSSNID
    </TextField><TextField>    SSN: 123-98-7654
    </TextField><TextField>
    PersonOtherID
    </TextField><TextField>    ID: XT-01020304050</TextField><TextField>
    </TextField><TextField>
    PersonPhysicalDetails
    </TextField><TextField>    PersonSexCode: M</TextField><TextField>
    </TextField><TextField>    PersonRaceCode: W</TextField><TextField>
    </TextField><TextField>
    PersonAbcdID
    </TextField><TextField>    ID: Z123456789</TextField><TextField>
    </TextField><TextField>    ExpandedBirthDateSearch: 1</TextField><TextField>
    </TextField><TextField>    ExpandedNameSearchIndicator: false</TextField><TextField>
    </TextField><TextField>
    VehicleID
    </TextField><TextField>    ID: ASDFASDFASDFASDFA</TextField><TextField>
    </TextField><TextField>    VehicleMakeText: DODG</TextField><TextField>
    </TextField><TextField>
    VehicleRegistrationPlateID
    </TextField><TextField>    ID: ABC123</TextField><TextField>
    </TextField><TextField>    IDJurisdictionText: AZ</TextField><TextField>
    </TextField><TextField>
    PrimaryResponse
    </TextField><TextField>
    PersonAlias
    </TextField><TextField>
    PersonAlternateName
    </TextField><TextField>    PersonGivenName: JACK</TextField><TextField>
    </TextField><TextField>    PersonMiddleName: ALLEN</TextField><TextField>
    </TextField><TextField>    PersonSurName: DANIEL</TextField><TextField>
    </TextField><TextField>
    PersonAlternateName
    </TextField><TextField>    PersonGivenName: JACKIE</TextField><TextField>
    </TextField><TextField>    PersonSurName: DANIEL</TextField><TextField>
    </TextField><TextField>
    PersonAlternateName
    </TextField><TextField>    PersonGivenName: JD</TextField><TextField>
    </TextField><TextField>    PersonSurName: DANIEL</TextField><TextField>
    </TextField><TextField>    PersonBirthDateText: 1967-01-01</TextField><TextField>
    </TextField><TextField>    PersonBirthDateText: 1968-01-01</TextField><TextField>
    </TextField><TextField>
    PersonAssignedIDDetails
    </TextField><TextField>
    PersonSSNID
    </TextField><TextField>    SSN: 234-00-0001
    </TextField><TextField>
    PersonSSNID
    </TextField><TextField>    SSN: 345-00-0002
    </TextField><TextField>
    PersonSSNID
    </TextField><TextField>    SSN: 456-00-0003
    </TextField><TextField>
    PersonSSNID
    </TextField><TextField>    SSN: 567-00-0004
    </TextField><TextField>
    PersonOtherID
    </TextField><TextField>    ID: XZ1234DE</TextField><TextField>
    </TextField><TextField>
    PersonOtherID
    </TextField><TextField>    ID: YZE6241</TextField><TextField>
    </TextField><TextField>
    </Message>
    

    In the above, the (…break to next line…) sequences are CR/LF generated by the stylesheet’s pieces.

    The schema for the message above is simple:

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:xsi={application-specific namespace} xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:annotation>
        <xs:appinfo>
          <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
          <b:schemaInfo root_reference="Message" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" standard="Flat File" />
        </xs:appinfo>
      </xs:annotation>
      <xs:element name="Message">
        <xs:annotation>
          <xs:appinfo>
            <b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
          </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:annotation>
              <xs:appinfo>
                <b:groupInfo sequence_number="0" />
              </xs:appinfo>
            </xs:annotation>
            <xs:element maxOccurs="unbounded" name="TextField" type="xs:string">
              <xs:annotation>
                <xs:appinfo>
                  <b:fieldInfo sequence_number="1" justification="left" />
                </xs:appinfo>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    

    In Visual Studio, the schema editor tree shows how simple the schema really is:

    <Schema>                (Schema Editor Extensions is set to Flat File Extension)
        Message         (a record with no default properties)
            TextString      (a child element defined as unbounded)
    

    BizTalk mapping:
    1. There are no functoids on the map because it will use the custom XSLT file to produce a message using the target schema described above.
    2. Using Validate Map, generated the Custom Extension XML file.
    3. Added the Custom Extension XML and my stylesheet files to the project.
    4. On the map design surface, set Custom Extension XML and Custom XSL Path properties by navigating to the files just mentioned.

    Created a BizTalk pipeline that includes a Flat file assembler using the target schema.

    Deployed the solution.

    Configured the send port to use the new send-pipeline.

    The final output is a flat file that looks like this:

    Message
    
    HeaderArea
        TransactionKeyText: PQ
        TransactionHeaderText: XYXY1010Z
    
    ResponseDataSection
      **TEST**THIS RESPONSE IS FROM ABCD TEST SYSTEM.
    
    PersonName
        PersonGivenName: JACK
        PersonMiddleName: DANIEL
        PersonSurName: WEBBER
        PersonBirthDateText: 1975-01-31
    
    PersonAssignedIDDetails
    
    PersonSSNID
        SSN: 123-98-7654
    
    PersonOtherID
        ID: XT-01020304050
    
    PersonPhysicalDetails
        PersonSexCode: M
        PersonRaceCode: W
    
    PersonAbcdID
        ID: Z123456789
        ExpandedBirthDateSearch: 1
        ExpandedNameSearchIndicator: false
    
    VehicleID
        ID: ASDFASDFASDFASDFA
        VehicleMakeText: DODG
    
    VehicleRegistrationPlateID
        ID: ABC123
        IDJurisdictionText: AZ
    
    PrimaryResponse
    
    PersonAlias
    
    PersonAlternateName
        PersonGivenName: JACK
        PersonMiddleName: ALLEN
        PersonSurName: DANIEL
    
    PersonAlternateName
        PersonGivenName: JACKIE
        PersonSurName: DANIEL
    
    PersonAlternateName
        PersonGivenName: JD
        PersonSurName: DANIEL
        PersonBirthDateText: 1967-01-01
        PersonBirthDateText: 1968-01-01
    
    PersonAssignedIDDetails
    
    PersonSSNID
        SSN: 234-00-0001
    
    PersonSSNID
        SSN: 345-00-0002
    
    PersonSSNID
        SSN: 456-00-0003
    
    PersonSSNID
        SSN: 567-00-0004
    
    PersonOtherID
        ID: XZ1234DE
    
    PersonOtherID
        ID: YZE6241
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very complex controller with a very complex set of views and
I have a very complex web app project I want to re-structure. Naturally, it
We have a very complex Oracle package here (over 4,100 lines of code) that's
I have a very complex Microsoft Access report. This report is run for multiple
I have a rather complex data source for my UITableView. I am very carefully
i have very serious problem if any tech expert can help...thank you in advance..
I have very simple piece of code. The goal is when i input four-digit
I have very very big html page/data. I need to fetch data under h1
All, I have a very general question regarding a future project. I need to
A very simple feature with complex inside. I want when a user input tag,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.