I am not sure why you need the HealthShare SDA schema, but I think it is
worth discussing the more general issue of writing out an XML schema
from Cache/Ensemble/HealthShare. The %XML.Schema class is designed to
work in conjunction with %XML.Writer to write out XML schema information.
Have you investigated using this approach?
Dale
You should be able to get the schema output using code similar to the
following:
Set schema = ##class(%XML.Schema).%New()
Set writer = ##class(%XML.Writer).%New()
Set writer.Indent = 1
Set status = writer.OutputToFile("Test_File.xsd")
If $$$ISERR(status) Quit status
Set status = writer.AddSchemaNamespace()
If $$$ISERR(status) Quit status
Set status = schema.AddSchemaType("HS.SDA.Container")
If $$$ISERR(status) Quit status
Set node = schema.GetSchema("") // empty namespace
If $IsObject(node) {
Set status = writer.DocumentNode(node)
If $$$ISERR(status) Quit status
}
Quit status
The approach you are using for your code below is for writing out the
contents of an object instance, not for writing out the schema for an
object.
I hope that helps,
Dale