Topic
  • 6 replies
  • Latest Post - ‏2013-07-16T13:19:25Z by harish8115
harish8115
harish8115
24 Posts

Pinned topic DataPower xs:Date validation

‏2013-07-14T19:31:24Z | datapower validation xs:date

I have a Web Service Proxy configured on DataPower XI50 appliance. One of the data elements that the service accepts is the date. This has been defined as xs:Date in the XSD file. While DataPower is allowing dates when submitted in format, 2013-07-14, it is throwing a schema validation error when date is submitted in format, 2013/07/14. The latter is a valid date format which the back end service is accepting when submitted directly (not through DataPower).

Please advise on how I can resolve this issue.

  • HermannSW
    HermannSW
    7404 Posts
    ACCEPTED ANSWER

    Re: DataPower xs:Date validation

    ‏2013-07-16T07:37:51Z  
    • David07
    • ‏2013-07-16T04:56:37Z

    Hi Harish,

    Actually we prefer Websphere Transformation Extender Design Studio for Binary Transformation.For your scenario, you can use Extensible Stylesheet Language for the Date Transformation.

    David

    XPath translate() function is enough to correct date:

    $ echo "<d>2013-07-14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $ echo "<d>2013/07/14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • Rohit-Goyal
    Rohit-Goyal
    155 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-15T04:35:17Z  

    It is not DataPower issue. You need to change the XSD to allow required format you want.

    Rohit

  • David07
    David07
    79 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-15T04:58:20Z  

    Hi harish,

    As Rohit said the problem you are facing is not with the datapower. For XML Schema W3C recommended syntax is 'yyyy-mm-dd', since your backend will accept 'yyy/mm/dd' this format  you have to transform the date using styleshhet according to your backend needs.

    David

  • harish8115
    harish8115
    24 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-15T15:29:14Z  

    Rohit / David - Thank you for your response.

    I am planning on using the WebSphere Transformation Extender Design Studio for constructing the transformation rules. Is this a suited solution or are there other tools that I should consider?

    Please advise.

  • David07
    David07
    79 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-16T04:56:37Z  

    Rohit / David - Thank you for your response.

    I am planning on using the WebSphere Transformation Extender Design Studio for constructing the transformation rules. Is this a suited solution or are there other tools that I should consider?

    Please advise.

    Hi Harish,

    Actually we prefer Websphere Transformation Extender Design Studio for Binary Transformation.For your scenario, you can use Extensible Stylesheet Language for the Date Transformation.

    David

  • HermannSW
    HermannSW
    7404 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-16T07:37:51Z  
    • David07
    • ‏2013-07-16T04:56:37Z

    Hi Harish,

    Actually we prefer Websphere Transformation Extender Design Studio for Binary Transformation.For your scenario, you can use Extensible Stylesheet Language for the Date Transformation.

    David

    XPath translate() function is enough to correct date:

    $ echo "<d>2013-07-14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $ echo "<d>2013/07/14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • harish8115
    harish8115
    24 Posts

    Re: DataPower xs:Date validation

    ‏2013-07-16T13:19:25Z  
    • HermannSW
    • ‏2013-07-16T07:37:51Z

    XPath translate() function is enough to correct date:

    $ echo "<d>2013-07-14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $ echo "<d>2013/07/14</d>" | xpath++ "translate(., '-', '/')" -
    2013/07/14
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Thank you! I understand that the date translation is quite simple. I was looking to understand which is the preferred tool to use to build more complex transformation maps. Please advise.