Consultor Eletrônico



Kbase P157874: 4GL/ABL: Error (9082) Invoking the SET-ATTRIBUTE() method to set xmlns attribute on the root node.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/6/2010
Status: Verified

SYMPTOM(s):

4GL/ABL: Error (9082) Invoking the SET-ATTRIBUTE() method to set xmlns attribute on the root node.

X-NODEREF or X-DOCUMENT SAVE got an error: Attempt to re-declare namespace prefix <namespace-prefix> in element <element-name>. It is already declared for namespace <namespace-name>. (9082)

The error is generated when xecuting a statement similar to either of the following two statements:

hRoot:SET-ATTRIBUTE("xmlns", "http://www.example.com").

hXworkbook:SET-ATTRIBUTE("xmlns","urn:schemas-microsoft-com:office:spreadsheet").

FACT(s) (Environment):

Attempt to re-declare namespace prefix raises error (9082)
Invoking SAVE method against xml document
xmlns attribute added to root node
OpenEdge 10.2B
All Supported Operating Systems

CHANGE:

Upgraded to 10.2B FCS

CAUSE:

Bug# OE00194275

FIX:

Upgrade to 10.2B01 or later.
There are also two available workarounds:
Option #1
Remove the code that sets attributes that look like namespace declarations (for example hNode:SET-ATTRIBUTE("xmns", "uri") or hNode:SET-ATTRIBUTE("xmlns:prefix", "uri")).

Option #2

1. Change all CREATE-NODE( ) to CREATE-NODE-NAMESPACE( ) calls. The URI used in these new calls will be based on the location of the SET-ATTRIBUTE( ) calls that look like namespace declarations.

2. Replace all X-NODEREF:SET-ATTRIBUTE( ) calls that do NOT look like namespace declarations with a X-DOCUMENT:CREATE-NODE-NAMESPACE(handle, uri, qualified-name, "attribute"), X-NODE-REF:NODE-VALUE assignment and then a X-NODE-REF:SET-ATTRIBUTE-NODE( ) call. Again, the uri used in the these calls will be based on the location of the SET-ATTRIBUTE( ) calls that look like the namespace declarations.

3. Remove all SET-ATTRIBUTE( ) calls that look like namespace declarations. For example: Each group of commented out lines is followed by the result of following the three steps above. The APPEND-CHILD( ) calls is common to both sets of node creations.

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet">
<Worksheet ssName="quarterlyCalcs" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Table/>
</Worksheet>
</Workbook>

/* hXdoc:CREATE-NODE(hXworkbook, "Workbook","element"). */
/* hXworkbook:SET-ATTRIBUTE("xmlns","urn:schemas-microsoft-com:office:spreadsheet"). */
hXdoc:CREATE-NODE-NAMESPACE(hXworkbook, ""urn:schemas-microsoft-com:office:spreadsheet", "Workbook", "element").

hXdoc:APPEND-CHILD(hXworkbook).

/* hXdoc:CREATE-NODE(hXworksheet, "Worksheet","element"). */
/* hXworksheet:SET-ATTRIBUTE("ss:Name", "quarterlyCalcs"). */
/* hXworkbook:SET-ATTRIBUTE("xmlns:ss","urn:schemas-microsoft-com:office:spreadsheet"). */
hXdoc:CREATE-NODE-NAMESPACE(hXworksheet,"urn:schemas-microsoft-com:office:spreadsheet", "Worksheet","element").
hXdoc:CREATE-NODE-NAMESPACE(hXNameAttr,"urn:schemas-microsoft-com:office:spreadsheet", "ss:Name","attribute").
hXNameAttr:NODE-VALUE="quarterlyCalcs".
hXWorksheet:SET-ATTRIBUTE-NODE(hXNameAttr).

hXworkbook:APPEND-CHILD(hXworksheet).

/*hXdoc:CREATE-NODE(hXTable,"Table","element").*
hXdoc:CREATE-NODE-NAMESPACE(hXTable,"urn:schemas-microsoft-com:office:spreadsheet","Table","element").

hXworksheet:APPEND-CHILD(hXtable).

If neither of the suggested workarounds above resolve this issue for you, please contact the Progress Technical Support for further assistance.