Topic
  • 8 replies
  • Latest Post - ‏2013-01-09T18:14:59Z by SystemAdmin
SystemAdmin
SystemAdmin
6772 Posts

Pinned topic Not able to make xsl:analyze-string work on incoming SOAP XML

‏2013-01-07T18:10:27Z |
Hi,
I am trying to log the incoming SOAP XML to my WSP via SYSLOG and since the logtarget truncates messages after size 2K ,I am trying to split the xml based on size and then log the message.Before splitting the xml ,I am first removing the security header and then performing the split .
Below is the xsl I am using,
<xsl:output method="xml"/>
<xsl:template name="secheader" match="wsse10:Security | wsse-d12:Security | wsse-d13:Security">
<!-- strip Security -->
</xsl:template>
<xsl:template name="matchall" match="@*">
<xsl:copy/>
</xsl:template>
<xsl:template name="matchelse" match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="/">
<xsl:call-template name="secheader"/>
<xsl:call-template name="matchall"/>
<xsl:variable name="incomingRequest">
<xsl:call-template name="matchelse"/>
</xsl:variable>

<xsl:analyze-string regex=".{{7}}" select="$incomingRequest">
<xsl:matching-substring>
<xsl:message dp:type="txnLog" dp:priority="notice">
<xsl:value-of select="."/>
</xsl:message>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:message dp:type="txnLog" dp:priority="notice">
<xsl:value-of select="."/>
</xsl:message>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>

The xsl is not producing any results.Please help
Updated on 2013-01-09T18:14:59Z at 2013-01-09T18:14:59Z by SystemAdmin
  • swlinn
    swlinn
    1348 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-07T20:40:55Z  
    xsl:analyze-string is a xslt version 2.0 function and is not supported. The same for xsl:matching-substring and xsl:non-matching-substring.

    Regards,
    Steve
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-07T22:02:18Z  
    • swlinn
    • ‏2013-01-07T20:40:55Z
    xsl:analyze-string is a xslt version 2.0 function and is not supported. The same for xsl:matching-substring and xsl:non-matching-substring.

    Regards,
    Steve
    Thanks for the reply Steve.. Is there an easy way of implementing the functionality I am looking for using supported functions?
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-08T01:36:21Z  
    Thanks for the reply Steve.. Is there an easy way of implementing the functionality I am looking for using supported functions?
    One alternate could be using a Log-Action instead of <xsl:message>

    I think the limit of 2K is only when with <xsl:message> not with Log-Action.

    RG
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-08T04:06:59Z  
    One alternate could be using a Log-Action instead of <xsl:message>

    I think the limit of 2K is only when with <xsl:message> not with Log-Action.

    RG
    As far as I know logs from datapower will be truncated whether we are using Log Action(configured for syslog) or Log Target.Please refer to the below link.
    http://www-01.ibm.com/support/docview.wss?uid=swg21448593
  • Daviiid
    Daviiid
    289 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-08T15:03:30Z  
    • swlinn
    • ‏2013-01-07T20:40:55Z
    xsl:analyze-string is a xslt version 2.0 function and is not supported. The same for xsl:matching-substring and xsl:non-matching-substring.

    Regards,
    Steve
    Steve

    You said that xslt version 2.0 is not supported. But i see that in xml manager , Compile Options Policy there is a parameter called XSLT Version . We can choose between XSLT 1.0 and XSLT 2.0

    (screenShot)
  • HermannSW
    HermannSW
    4741 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-08T15:14:04Z  
    As far as I know logs from datapower will be truncated whether we are using Log Action(configured for syslog) or Log Target.Please refer to the below link.
    http://www-01.ibm.com/support/docview.wss?uid=swg21448593
    Please attach a sample request -- with regexp:replace() it should be possible to do what you want.

    DataPower provides a big set of EXSLT extension functions, see this posting (especially this table):
    https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/entry/exslt_support_in_datapower_firefox_xalan_xsltproc12

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • HermannSW
    HermannSW
    4741 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-08T15:18:17Z  
    • Daviiid
    • ‏2013-01-08T15:03:30Z
    Steve

    You said that xslt version 2.0 is not supported. But i see that in xml manager , Compile Options Policy there is a parameter called XSLT Version . We can choose between XSLT 1.0 and XSLT 2.0

    (screenShot)
    "... The support for XSLT 2.0 and XPath 2.0 is currently limited to the decimal data type. ..."
    http://pic.dhe.ibm.com/infocenter/wsdatap/v5r0m0/index.jsp

    And there are conversion functions:
    http://pic.dhe.ibm.com/infocenter/wsdatap/v5r0m0/index.jsp?topic=%2Fcom.ibm.dp.xa.doc%2Fextensionfunctions235.htm

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Not able to make xsl:analyze-string work on incoming SOAP XML

    ‏2013-01-09T18:14:59Z  
    • HermannSW
    • ‏2013-01-08T15:18:17Z
    "... The support for XSLT 2.0 and XPath 2.0 is currently limited to the decimal data type. ..."
    http://pic.dhe.ibm.com/infocenter/wsdatap/v5r0m0/index.jsp

    And there are conversion functions:
    http://pic.dhe.ibm.com/infocenter/wsdatap/v5r0m0/index.jsp?topic=%2Fcom.ibm.dp.xa.doc%2Fextensionfunctions235.htm

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    Hello Hermann ..I am not sure how to implement the same functionality with regex:replace().As of now I have implemented with substring function with recursive template call(for loop).