Consultor Eletrônico



Kbase 21708: Duplicate Attribute: Error loading XML document.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/28/2008
Status: Verified

FACT(s) (Environment):

Progress 9.1C

SYMPTOM(s):

Error: Duplicate Attribute

Loading an XML Document

CAUSE:

The XML parser in Progress V9.1C has XML namespace support enabled by default which means the XML document gets loaded with namespaces enabled and will cause problems if namespace and non-namespace aware DOM methods are then mixed. There is a attribute named SUPPRESS-NAMESPACE-PROCESSING that can be set before loading the document so that the document will be processed correctly.

FIX:

The solution is to set the SUPPRESS-NAMESPACE-PROCESSING attribute to true, before loading the original document ( hDoc:LOAD ).
This is a snippet of example code on where to set the attribute.


DEFINE VARIABLE hDoc AS HANDLE.
DEFINE VARIABLE hRoot AS HANDLE.
DEFINE VARIABLE hnewDoc AS HANDLE.
DEFINE VARIABLE hnewroot AS HANDLE.

CREATE X-DOCUMENT hDoc.
CREATE X-NODEREF hRoot.
CREATE X-DOCUMENT hnewDoc.
CREATE X-NODEREF hnewRoot.

/*************** setting attribute **************/
hDoc:SUPPRESS-NAMESPACE-PROCESSING = true.
/************************************************/

hDoc:LOAD("file","c:\Whatever.xml",FALSE).
hDoc:GET-DOCUMENT-ELEMENT(hRoot).

hnewdoc:IMPORT-NODE(hnewroot,hroot,FALSE).
hnewdoc:APPEND-CHILD(hnewroot).