Write a ProDataSet definition to XML Schema files
- Last Updated: June 7, 2019
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Temp-table members of a ProDataSet can have a NAMESPACE-URI attribute
that differs from the NAMESPACE-URI of the ProDataSet.
In this case, the WRITE-XMLSCHEMA( ) method
uses a separate XML Schema document for the temp-table definition,
since the XML Schema TargetNamespace attribute
is different.
In other words, suppose your ProDataSet has three temp-table buffers. The ProDataSet defines a default namespace. The first temp-table buffer does not define a default namespace. Therefore, it uses the default namespace defined by its parent ProDataSet. The second temp-table buffer defines the same default namespace as the ProDataSet. So far, only a single XML Schema file is needed because only one namespace has been used. Suppose the third temp-table buffer defines a different default namespace. The method now needs to create a second XML Schema file for this temp-table buffer.
This code sample demonstrates the ability of the WRITE-XMLSCHEMA( ) method
to write different XML Schema files for different namespaces. For
example:
- The method writes one XML Schema file for the namespace associated with the ProDataSet definition.
- The method writes one XML Schema file for each temp-table with a different namespace.
The following is an abbreviated version of the include file that sets up the ProDataSet. Note the variety of namespaces used:
|
The following is the main code (note that only a single target file name is specified):
|
This is the standard Open dialog box set
up to show *.xsd files in the working directory:

The method call created four .xsd files and
used the specified file name as the main ProDataSet-level XML Schema
file. It also used the name as a root for naming other .xsd files
it needed to create for temp-table buffers with different namespaces.
When reading this XML Schema, an application would find the child
XML Schemas from the import directives in the in
the main XML Schema. For example, here is a snippet of prodataset.xsd showing
the imports:
|
FILE"),
otherwise it returns an error.