Hi !
We've been developing with fjs BDL for more than twenty years, but I think this is our first time here, so hello to everybody !
This program:
import xml
type TContent record
data string
end record
type TDoc record
content TContent ATTRIBUTE(XMLNamespace="http://sgth.es/XSD/v1.0/content")
end record
main
define
doc TDoc ATTRIBUTE(XMLName="doc", XMLNamespace="http://sgth.es/XSD/v1.0/doc"),
dom_doc xml.DomDocument,
node xml.DomNode
let doc.content.data = "kkkkk"
let dom_doc = xml.DomDocument.Create()
let node = dom_doc.createDocumentFragment()
call xml.Serializer.VariableToDom(doc, node)
call dom_doc.appendDocumentNode(node)
display dom_doc.saveToString()
end main
Produces this output:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fjs1:doc xmlns:fjs1="http://sgth.es/XSD/v1.0/doc">
<fjs2:content xmlns:fjs2="http://sgth.es/XSD/v1.0/content">
<fjs2:data>kkkkk</fjs2:data>
</fjs2:content>
</fjs1:doc>
Is it possible to get this output?:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<fjs1:doc xmlns:fjs1="http://sgth.es/XSD/v1.0/doc" xmlns:fjs2="http://sgth.es/XSD/v1.0/content">
<fjs2:content>
<fjs2:data>kkkkk</fjs2:data>
</fjs2:content>
</fjs1:doc>
We need to build an xml that must conforms to a very rigid schema, and this multi namespace declaration in root tag is mandatory.
Thanks !