Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updates SNAP-7253

In this article

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

Snap type:

Transform

Description:

This Snap reads the binary data and applies the XSLT transformation rules and writes out the resulting documents. This Snap supports 1.0, 2.0 standards.

Prerequisites:

The input binary data must use UTF-8 encoding. If non-UTF-8 encoded data or a special character is passed, it results in an error: "Error view with behavior continue received a new type of error." Refer to the Troubleshooting section below for steps to resolve this error.

Support and limitations:

Works in Ultra Task Pipelines

Account: 

Accounts are not used with this Snap.

Views:


InputThis Snap has exactly one binary input view, where it accepts binary data.
OutputThis Snap has exactly one binary output view and produces binary data that was produced by the XSLT Transformer.
ErrorThis Snap has at most one document error view and produces zero or more documents in the view.


Troubleshooting:


Error MessageReasonResolution

Error view with behavior continue received a new type of error.

If data with coding other than UTF-8 or a special character is passed to the XSLT Snap, an error is displayed during Pipeline execution. This happens because the XSLT Snap is configured to accept UTF-8 encoded data only.

Add the Transcoder Snap before the XSLT Snap.

In the Transcoder Snap Settings, specify your current character set in the Input character-set field and UTF-8 in the Output character-set field.


Settings

Label

Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Schema


Schema of the incoming data provided as XSD.

Examplesldb:///my_schema/foo.xsd

Validate input


Required. Specifies the incoming data to be validated against the provided XSD schema definition in Inbound Schema property.


Note

If you enter an Inbound schema, then you must select Validate XML and Match data types properties to derive the output as per the defined schema. 

Example: False

Default value: False 

Info

Java 8 throws an error if the maxOccurs value in your XSD file is greater than 5000. To overcome this error, set maxOccurs to unbounded. If you cannot modify the XSD, perform the following:

  1. In the SnapLogic application, navigate to Manager > Project Spaces.

  2. Click on your Project.

  3. Click the Snaplexes tab and click on the Snaplex that you want to update.
    The Update Snaplex dialog box appears.

  4. Under Global properties, click + to add a Key and Value.

  5. Enter jcc.jvm_options in Key.

  6. Enter -Djdk.xml.maxOccurLimit=0 in Value.

  7. Click Update

  8. Restart the JCC.


XSLT


Required. Transforms the incoming XML document based on the XSLT Transformation rules. 

Examplesldb:///my_xslt/converter.xslt

Note
titlePass values dynamically

You can also dynamically pass parameter values to the Snap instead of passing an XML input, by configuring the intended parameter values in an upstream Mapper Snap. Ensure that the intended parameters are defined in the template's header.  

For example, consider the following XML:

Paste code macro
languagexml
titleSample XML
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
  </cd>
  <cd>
    <title>Hide your heart</title>
    <artist>Bonnie Tyler</artist>
    <country>UK</country>
    <company>CBS Records</company>
    <price>9.90</price>
    <year>1988</year>
  </cd>
  <cd>
    <title>Greatest Hits</title>
    <artist>Dolly Parton</artist>
    <country>USA</country>
    <company>RCA</company>
    <price>9.90</price>
    <year>1982</year>
  </cd>
</catalog>


To pass a dynamic value for the parameter title, you would include this parameter in the XML stylesheet template (XSLT) as follows:

Paste code macro
languagexml
titleXSLT to include dynamic parameters
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:param name="title"/>
   <xsl:template match="/">
      <html>
         <body>
            <xsl:for-each select="catalog/cd">
               <p>Title:<xsl:value-of select="$title"/></p>
            </xsl:for-each>
         </body>
      </html>
   </xsl:template>
</xsl:stylesheet>


Note

Fixes an issue in a previous patch wherein null binary header values are now converted to blank strings when injecting them as parameters in the stylesheet.



Format as canonical XML

Select to produce a canonical XML output.  

The canonical form of an XML output is an XML representation that excludes the XML prolog and includes the start and end tag for all the XML elements.

Default value: Not selected 

Multiexcerpt include macro
nameSnap Execution
pageAnaplan Read

Multiexcerpt include macro
nameSnap_Execution_Introduced
pageAnaplan Read

See it in Action


 

Widget Connector
urlhttp://youtube.com/watch?v=nbCnc-qQ7z8

Excerpt Include
Transform Snap Pack
Transform Snap Pack
nopaneltrue