4GL XML defining a node with namespaces

Posted by mauromarchi on 02-Feb-2020 14:31

Hi to all

I did a 4GL that created a XML document with DOM methods

I need to create an XML document with declatives of namespaces in main node

<lista_app_catalogo xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-istance">

I did that but i was not sure it is correct or best solution

I did want to have problems of validation with XML file

I have to upload this XML file in a thirdy part web site.

I attach my code :

======================================================================

                                           
hDoc:CREATE-NODE(hRoot,"lista_app_catalogo","ELEMENT").               

hRoot:SET-ATTRIBUTE("xmlns:xsi","www.w3.org/.../XMLSchema-istance").   
hRoot:SET-ATTRIBUTE("xmlns:xsd","www.w3.org/.../XMLSchema").         

 

it works but i am not sure to did right and best solution.

===================================================================

i read also about CREATE-NODE-NAMESPACE and or SET-ATTRIBUTE-NODE but i was not able to use them 
                                                                               
/***hDoc:CREATE-NODE-NAMESPACE                                                 
                 (hRoot                                                        
                 ,"www.w3.org/.../XMLSchema-istance"                   
                 ,"lista_app_catalogo"                                         
                 ,"ELEMENT").***/                                               
                                                                               

Any suggestions are welcome.

All Replies

This thread is closed