1

Requirement: Dynamic schema validation.

The request URL will contain the function name in query string.

http://DataPowerIP:Port/CD_HTML/AOL.jsp?function_id=YY_TD_ICT_CER_CREATE

DataPower will have multiple XSDs in its file management. Need an XSLT which can help t0 fetch the query string from the URL and extract the function idYY_TD_ICT_CER_CREATE.

Next it will match function id name with the XSD file name YY_TD_ICT_CER_CREATE.xsd and if match found will do the scema validation.

Sammy
  • 121
  • 4
  • 12

2 Answers2

2

In your XSL, you can get your URI via dp:variable('var://service/URI'). Write your code to parse out the function_id into an xsl:variable. Then set a DataPower context variable with the name of the schema file to be used for validation:

<dp:set-variable name="'var://context/this/schema-file'"
    value="concat('local:///my-schemas/', $function-id-value, '.xsd')"/>

The next step in your policy after this XSL Transform step will be a validate step. In the place where you normally specify a static local XSD, specify the context variable instead:

DataPower Validate using var

bjimba
  • 928
  • 8
  • 13
0

alternmatively you can do Schema validation in stylesheet processing URL-in directly via the dp:schema-validate() extension function.

But I don't really see the value of allowing Schema validations against a client specified Schema, at least in general. Schema validation should make sure that input data is valid. In case client can point to any Schema (eg. via "http://..." URL for the Schema) bad input does not get rejected.

Hermann.

bzupnick
  • 2,646
  • 4
  • 25
  • 34
HermannSW
  • 161
  • 1
  • 8