Xml instance into IS document

how can an IS document be created so that when an xml instance document comes in, the IS document retains the structure of the xml schema to which the instance document conforms?

thanks,
mow

The integration server converts the xml document to a node object. The actual structure of the document is created by calling the service documentToRecord or xmlNodeToDocument. In order to retain the structure of the schema you have to import the schema and create a Record/DocumentType from it. Then you specify the name of the record/documentType in the corresponding inputs to the documentToRecord/xmlNodeToDocument service. This will create the structure in compliance with the schema.

Thank you very much. appreciate your help.

mow

Just a quick question, should it be in the input or the output spec of xmlnodetodocument ?

It is not the spec. When you call the service xmlNodeToDocument it has an input called documentTypeName. Assign the name of the DocumentType created from the schema to this variable. You can get more details in the Built-In Services guide.

Ok, I tried this. however, I noticed that elements that are optional in the input xml instance do not show up in the document. Actually, what I wanted is a placeholder for all elements which apppeared in the original schema. Is this something that can be achieved?

thanks,
mow

If an element is optional and it is not present in the XML too, you will not get it in the output. Because, if it does appear in the output, what value would it have since none was assigned to it in the XML ?

BTW: When generating a XML document with recordToDocument there is an option to create nil valued elements in the created XML for keys that are not in the pipeline.