Skip to Content

Suppress Namespace with XMLAnonymizerBean gives not the expected result

Hi all,

I have to convert an idoc-xml to cXML and send it by SOAP-Adapter. As a Result I get a XML-Strucutre like:

<?xml version="1.0" encoding="UTF-8" ?>

http://tempuri.org/cXML" payloadID="xxxxxxx" timestamp="2011-02-04 08:22:04" xml:lang="en-US">

<ns0:Header>

<ns0:From>

<ns0:Credential domain="xxx">

</ns0:Credential>

</ns0:From>

......

According to the SDN-Forum entries I tried to use the XMLAnonymizerBean to suppress the "ns0:" with

Modules:

1 AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0

2 sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean Local Enterprise Bean soap

Module Configuration

0 anonymizer.acceptNamespaces "http://tempuri.org/cXML" ""

0 anonymizer.quote "

I also tried single quotes.

The Audit Protokoll said:

2011-02-04 08:22:05 Information Anonimizer: anonymizing XML ...

2011-02-04 08:22:05 Information Anonimizer: successfully anonymized

But the resulting XML-Struktur was the same as before. What went wrong ?

Please help

Detlef Rathke

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 04, 2011 at 09:25 AM

    Try module config

    0 anonymizer.acceptNamespaces http://tempuri.org/cXML "(two single quotes)

    0 anonymizer.quote "

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 04, 2011 at 09:27 AM

    Hi,

    Ur configuration should be:

    0 anonymizer.acceptNamespaces http://tempuri.org/cXML ''

    /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

    Thanks

    Amit

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 04, 2011 at 09:45 AM

    Hi,

    >>>>>>>>to suppress the "ns0:"

    Save this below code as XSLT, zip and then import as external archive. And then add this as last step in Operation mapping. Hopefully, I think it is help for you out of your issue.

    <?xml version="1.0"; encoding="UTF-8"?>

    http://www.w3.org/1999/XSL/Transform">

    <ns0:output method="xml" encoding="UTF-8"/>

    <ns0:template match="/">

    <ns0:copy>

    <ns0:apply-templates/>

    </ns0:copy>

    </ns0:template>

    <ns0:template match="*">

    <ns0:element name="{local-name()}">

    <ns0:apply-templates select="@* | node()"/>

    </ns0:element>

    </ns0:template>

    <ns0:template match="@*">

    <ns0:attribute name="{local-name()}">

    <ns0:value-of select="."/>

    </ns0:attribute>

    </ns0:template>

    <ns0:template match="text() | processing-instruction() | comment()">

    <ns0:copy/>

    </ns0:template>

    </ns0:stylesheet>

    Regards,

    Rajesh

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 04, 2011 at 08:14 PM

    I see syntax error

    >>0 anonymizer.acceptNamespaces "http://tempuri.org/cXML" ""

    >>0 anonymizer.quote "

    0 anonymizer.acceptNamespaces http://tempuri.org/cXML "

    0 anonymizer.quote '

    Note: anonymizer.quote is used only for the attribute. This will work.

    Add comment
    10|10000 characters needed characters exceeded