Geoffrey mentioned just a few minutes back that one needed to wrap a JDBC query in an input and nds nodes.

This got me wondering.

How do most people approach this type of thing. Where I've seen this done they just embed an existing XDS document and parse-xml it.
The thing I thought about is that there is some versioning in the XDS document

Has anyone seen this break when your engine is running a vastly different from the version details you might specify in the parsed XML blob?

For example:

you are on recent IDM 4.0.2 version

<nds dtdversion="4.0" ndsversion="8.x">
<product edition="Advanced" version="">DirXML</product>
<contact>Novell, Inc.</contact>

but try and run an example with an outdated blob.

<nds dtdversion="3.5" ndsversion="8.x">
<product version="">DirXML</product>
<contact>Novell, Inc.</contact>

Finally, in some cases just having the "input" node wrapper is enough (or even just the command) anyone care to comment what has worked for you and where?

For example: the execute method of com.novell.nds.dirxml.driver.XdsCommandProcessor seems to be able to accept either a full XDS document or a well formed XDS fragment (either input or command level).

There is also com.novell.nds.dirxml.driver.cmd.DriverCmd - which is poorly documented but I think it requires a full XDS document.

What about dxcmd what does it require?

I came up with the following code to build a skeleton XDS blob dynamically at driver startup.

<description>Set the skeleton XDS</description>
<comment xml:space="preserve">This will always reflect the current engine version. Built on every startup.</comment>
<if-local-variable name="skeletonXDS" op="not-available"/>
<do-set-local-variable name="skeletonXDS" scope="driver">
<token-xpath expression="string(concat('&lt;',name(/*),'>&lt;input/>&lt;/',name(/*),'>'))"/>
<do-clone-xpath before="*[1]" dest-expression="$skeletonXDS/node()" src-expression="/*/source | /*/@*"/>
<do-trace-message level="1">
<token-xml-serialize notrace="true">
<token-local-variable name="skeletonXDS" notrace="true"/>