Document Type

Hello guys,
does anybody knows a way to get programatically a document type definition? I would like to check and traverse a document with all the attributes as well including string or integer size.



what is the further use case of this requirement?

Supposed we find a solution for retrieving the requested information, what do you plan to do with it.

Eventually there is an easier way to achieve what you are looking for, i.e. pub.schema:validate.


The real case is that we want to create a FFSchema out of an XSD definition. The XSD holds all the definition of length and data types.

That’s it. For sure there are other solutions but for the other solutions you do not need SAG :slight_smile:

Yes it is possible. Can you explore the WmFlatFileSamples code samples (you can get it from SAG tech community) and also the BIS services in WmFlatFile package.

Yes, it is possible. Kindly download and explore WmFlatFileSamples and also there are BIS services to create FF dictionary and schema in WmFlatFile package.

Let me know if you have further questions.

there is nothing in the WmFlatFileSample package. The question is how to get the document type definition programatically and not how to create a FFSchema.

Thanks in advance,

It is getting clearer slowly.

You can try to get the node.ndf from the DocumentType by getFile and parse that as an XML-Node or something similar.

The Path for the node.ndf will be “packages//ns//node.ndf”

path-to doc-type contains the complete folder-structure to and the name of the doc-type (replace dots and colons with slashes).


Try to invoke

Developed in version 9.7 but should be OK for lower version.

This is just a sample for string content type, you may need to modify it based on your situation. (13.5 KB)

will it help if you get XSD of IS document?

if yes then you can use WmPublic service pub.schema:createXSD to create xsd for your IS document and then use that xsd for further developments.

Hi Xiaowei,

the code that you provided is not generic one and it seems that it is does not work with the attached xsd. (13.5 KB)

Yes, it’s not generic, like I mentioned, just for string content type and min/max attribute(which is exactly you described in your first post). I hope it helps you to understand how to parse the content type in Document Type, not provide a total solution and stop you thinking.

BTW, I don’t see you upload any XSD.

the xsd is missing is a document type. I have one question. Where did you find this API? It is not documented or I had a look in the wrong place. Can you give me a hint?

It’s private API. I learn it from reading jar files under installation directory. :smiley: