String to Document how to respect document schema

Hi,

I have set up a service to create a document from a xml string:

pub.xml:xmlStringToXMLNode
pub.xml:xmlNodeToDocument

I encounter a problem on a document list in the document, if the string contain only one occurence of the list the final document countain a document not a documentlist

My document is like this:

Document
–string
–string
–DocumentList
----string
----string

But on the run if the string contain only one occurence of the list the document is like below:

Document
–string
–string
–Document
----string
----string

It cause some problem later because i need to do a loop on the Document List which is not consider as a document list

Is there a way to force xmlNodeToDocument to create the document with the same structure?
Or do i have to create a java service to check for the documentType?

Thanks for your concerns.

If you have an IS document created either from the schema or manually for conventional structure then you can provide its namespace as input “documentTypeName” while calling “pub.xml:xmlNodeToDocument”.

If you do not have a document created, but you know which XML tags should come as arrays, then set “makeArrays” as true and provide XML tag names inside “arrays” input of “pub.xml:xmlNodeToDocument” service.

Thanks it works as a charm now

Cheers!!!