header with delimiters

I'm creating a XML-output file. As usual, there are no delimiters between the tags. So the file is not readable with a simple textviewer (like notepad). But one of our customers needs this delimiters to process the XML.

I had introduced indent="yes" in the xsl:output node of xslt file. This seems to have worked for the output file. But a header will be added to the output file through a message assignment shape in the orchestration. I would the indent to be applicable to the header of the output file too.

Is there any parameter or work around to insert delimiters (crlf) to the header of the output XML-file?

January 10th, 2014 3:57pm

Refer to http://support.microsoft.com/kb/2786241/en-us which discusses on how the Whitespace is handled through mapping.

The other option is through a modified schema of the XML you generate for that partner. Refer http://www.w3schools.com/schema/schema_facets.asp, section "Restrictions on Whitespace Characters". These are honored by BizTalk.

I however am confused about "But one of our customers needs this delimiters to process the XML.". Do they process through an application written by them or do they use a standard package. If it is a homegrown application then they can change their handling to support XML (With and Without whitespace). If it is a standard package then there might be an option to configure the package to do the same.

Regards.

Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 4:18pm

To clarify, you want the Map output to be indented for readability?

The Map Grid Properties has an Indent property that you set to True go have the output indented (CR/LF + TAB).

What exactly to you mean by "header"?

January 10th, 2014 4:21pm

The output from the xslt is batched(there could be more than one jobs) and then a header is applied to it. Indentation is applied to the individual jobs through xslt. what can be done to the header bit?

Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 4:32pm

The following is the sample output file. Individual jobs are indented through xslt. Need header bit to be indented as well.

<message><header userid="" date="08/01/2014"><schema version="1" name="New" /><source productversion="" product="" system="" /><destination productversion="" product="" system="" /></header><body><jobs><job action="" contract="65" client_ref="4162213" description="OUT OF HOURS - no hot water " job_type="ELECR" required_date="03/12/2013 00:00">
  <job_lines>
    <job_line line_no="1" line_type="WE" code="Z04" description="OUT OF HOURS - TOTAL LOSS OF ELECTRICAL HEATING 1ST NOV TO 30TH APR" quantity="1">
    </job_line>
  </job_lines>
  <job_property ref="72121095" alt_ref="43558" name="44-49 Floor 7 FLAT 44                                   " short_name="44-49 Floor 7 FLAT 44                          " house_no="44 " street="Grantham Towers" address_line_1="44-49 Floor 7 FLAT 44 " tenant="Mr S Tsegaye">
  </job_property>
  <job_notes>
  </job_notes>
  <job_lines>
    <job_line line_no="1" line_type="XE" code="Z04" description="OUT OF HOURS - TOTAL LOSS OF Power failure 1ST NOV TO 30TH APR" quantity="1">
    </job_line>
  </job_lines>
  <job_property ref="72121096" alt_ref="43565" name="89 Floor 17 FLAT 34                                   " short_name="89 Floor 17 FLAT 34                          " house_no="89 " street="Grantham Towers" address_line_1="89 Floor 17 FLAT 34 " tenant="Mr S Tsegaye">
  </job_property>
  <job_notes>
  </job_notes>
  </job></jobs></body></message>

The expected output is as follows

<message>
 <header userid="" date="20/12/13">
  <schema version="1" name="new" />
  <source productversion="" product="" system="" />
  <destination productversion="" product="" system=""/>
 </header>
 <body>
  <jobs>
   <job action="" .............


  • Edited by ragavalli Friday, January 10, 2014 1:57 PM
January 10th, 2014 4:41pm

First, make absolutely sure the receive cannot accept the xml without indentation.  After ~15 years of Xml, that's a very odd requirement to have.

Either way, you have to go to wherever the <Header> is applied and make sure the output is indented.  Exactly how depends on exactly how <Header> is created.  If you can supply that detail, we can provide further guidence.

Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 9:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics