Dynamic XSD creation

Hi,

Is there any chance to create a XSD dynamically in webMethods?
Means,
i am getting a xml string (through webservices);

From xml string i need to read one value;

Based on that value i need to load a corresponding XSD from file system (can say Unix) where i could able to validate the Input structure (xml string).

I could able to do the till loading the xsd from file system. but later i am not able to move further (i.e. i need to create the retrieved xsd to validate the xml string).

Please suggest me how could i proceed further to achieve the goal.

thanks in advance.

regards,
ARK

I would suggest that you not load an XSD dynamically, but that you create document types from each XSD in advance and then derive the appropriate document type name from the qualified name of the XML document you are attempting to validate. Use that to populate the conformsTo parameter on the pub.xml:validate service.

You can get the localName and namespaceName of the root element of an XML node using either:

  • pub.xml:getXMLNodeType or
  • pub.xml:queryXMLNode with the XQL queries /*/namespace() and /*/nodeName()

Mark

Mark,

Thanks for quick response. But i have around 5000-6000 xsd based on the partners / customers. So, in that case i believe i could not follow the approach what you have specified (even earlier i also thought the same but when i came to know the numbers…).

Is there any way to create an xsd / schema dynamically?

regards,
ARK

ARK,

If you need to do something useful with the document after is has been validated, then you will need a document type in IS built from one of these schemas in order to work with the incoming document.

The number of partners and document types suggests that this might be a good fit for Trading Networks. TN will identify the correct document type based on structure or content of the incoming document, validate it and route it to the correct delivery or processing service.

If you are only planning on using IS to validate the document, I would suggest using another approach not involving IS.

Mark