Pavan Yadav
Member
Progress Version : 10.2B
Env : UNIX
I am creating a XML and instead of using SAX Parser, I am trying to achieve the functionality/Design with Temp-Tables/Datasets.
I am facing an issue with NameSpace-URI
Output for this is :
Can someone please advise, that why I am getting NameSPace URI with each elements ? I don't want it to be added with each elements(marked in RED should not be there) i.e it should not be with IC_ACTIONCODE , IC_MESSAGE_ID etc. Am i missing some parameter here?
Env : UNIX
I am creating a XML and instead of using SAX Parser, I am trying to achieve the functionality/Design with Temp-Tables/Datasets.
I am facing an issue with NameSpace-URI
Code:
DEFINE VARIABLE cTargetType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE lFormatted AS LOGICAL NO-UNDO.
DEFINE VARIABLE cEncoding AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSchemaLocation AS CHARACTER NO-UNDO.
DEFINE VARIABLE lWriteSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE lMinSchema AS LOGICAL NO-UNDO.
DEFINE VARIABLE lxmlWritten AS LOGICAL NO-UNDO.
DEFINE VARIABLE cUniqueVal AS CHARACTER NO-UNDO.
DEFINE TEMP-TABLE Rfc_Call NO-UNDO
NAMESPACE-URI "urn:Test:functions"
FIELD IC_ACTIONCODE AS CHARACTER
FIELD IC_MESSAGE_ID AS CHARACTER
FIELD IC_IF AS CHARACTER
FIELD IC_PARTNER_ID AS CHARACTER
FIELD IC_TRANSACTION_ID AS CHARACTER .
DEFINE TEMP-TABLE It_Data NO-UNDO
NAMESPACE-URI ""
FIELD Rfc_Call_id AS CHARACTER .
ASSIGN cUniqueVal = TRIM(STRING(1)) + TRIM(STRING('Test')).
CREATE Rfc_Call.
ASSIGN
IC_ACTIONCODE = 'Test'
IC_MESSAGE_ID = STRING(1)
IC_IF = 'Hello'
IC_PARTNER_ID = 'ID1'
IC_TRANSACTION_ID = cUniqueVal.
CREATE It_Data.
ASSIGN
Rfc_Call_id = cUniqueVal.
DEFINE DATASET _-Rfc_CallDset
SERIALIZE-HIDDEN
FOR Rfc_Call, It_Data
DATA-RELATION RELATION2 FOR Rfc_Call, It_Data
RELATION-FIELDS (IC_TRANSACTION_ID, Rfc_Call_id) NESTED.
ASSIGN
cTargetType = "file"
cFile = "D:\dset.xml"
lFormatted = TRUE
cEncoding = ?
cSchemaLocation = ?
lWriteSchema = FALSE
lMinSchema = FALSE.
lxmlWritten = DATASET _-Rfc_CallDset:WRITE-XML(cTargetType, cFile, lFormatted, cEncoding,
cSchemaLocation, lWriteSchema, lMinSchema).
Output for this is :
Code:
<?xml version="1.0"?>
<Rfc_Call xmlns="urn:Test:functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<IC_ACTIONCODE xmlns="urn:Test:functions">Test</IC_ACTIONCODE>
<IC_MESSAGE_ID xmlns="urn:Test:functions">1</IC_MESSAGE_ID>
<IC_IF xmlns="urn:Test:functions">Hello</IC_IF>
<IC_PARTNER_ID xmlns="urn:Test:functions">ID1</IC_PARTNER_ID>
<IC_TRANSACTION_ID xmlns="urn:Test:functions">1Test</IC_TRANSACTION_ID>
<It_Data xmlns="">
<Rfc_Call_id>1Test</Rfc_Call_id>
</It_Data>
</Rfc_Call>
Can someone please advise, that why I am getting NameSPace URI with each elements ? I don't want it to be added with each elements(marked in RED should not be there) i.e it should not be with IC_ACTIONCODE , IC_MESSAGE_ID etc. Am i missing some parameter here?
Last edited: