cancel
Showing results for 
Search instead for 
Did you mean: 

Change XML declaration from single quote to double quote

Former Member
0 Kudos

Hi all,

i have the following problem in my File Receiver Adapter. My XML File has the declaration <?xml version='1.0' encoding='utf-8'?> (With single quotes ') and want to change it to <?xml version="1.0" encoding="utf-8" ?> (With double quotes ")

I use the XMLAnonymizerBean but this does not change the XML declaration.

Any ideas how to change the declaration

Thanks Max

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi Max,

When you test message mapping (using the test tab), how the source of the target structure looks like?

Is it

>> <?xml version='1.0' encoding='utf-8'?> (With single quotes ')

or >> <?xml version="1.0" encoding="utf-8" ?> (With double quotes ")

In my XI box i am seeing double quotes.

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

the source and the target in the message mapping looks like <?xml version="1.0" encoding="UTF-8"?>

So why does the File Adapter change it to single quotes?

former_member187339
Active Contributor
0 Kudos

Hi,

Even the File adapter is creating Double quotes

So in your case I guess there is some module or configuration that is there which is making it as single quote.

Can you provide some more information on your receiver channel

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

on the Modul Tab i have the following:

1 | AF_Modules/XMLAnonymizerBean | Local Enterprise Bean | Anonymizer

2 | CallSapAdapter | Local Enterprise Bean | 0

____________________________________________________________

Anonymizer | anonymizer.acceptNamespaces | http://Post.AG/PartnerInterface/Schemas/PVSdeAt/Aviso_V1.0 ns0 http://PostAG.PartnerInterface.Schemas.PVS_deAt.AvisoHeader ns1 http://PostAG.PartnerInterface.Schemas.PVS_deAt.AvisoShipper ns2

Anonymizer | anonymizer.quote | "

That is all what i have on the module tab.

I send the data as Text (not Binär). Thats all what i have in the adapter. Do you need any further information?

Regards, Max

former_member187339
Active Contributor
0 Kudos

Hi,

Try removing the XMLAnonymizerBean bean and change mode to bin

BTW why you require XMLAnonymizerBean ?

Regards

Suraj

Former Member
0 Kudos

Hi Max,

The xml Annonymizer should do this. Check if you have added some extra space in your annonymizer.quote. By default xml Annonymizer gives the single quote (') . So might be its using the default value.

Regards,

Rahul.

Former Member
0 Kudos

Hi Suraj,

i cannot remove XMLAnonymizerBean becouse i need this to change the namespaces to ns0, ns1, etc.

Change to bin does'n change anything.

Regards, Max

Former Member
0 Kudos

Hi Rahul,

there are no extra spaces in annonymizer.quote! In the content it is change to " but not in XML declaration, so i think the annonymizer is working correct.

Any other ideas?

Regards, Max

former_member187339
Active Contributor
0 Kudos

Hi Max,

Try applying the patch as mentioned here

Note 1019104 - XML Anonymizer module attribute quote problem

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

the Patch 1019104 is already in the System. We have Support Stack 15 installed.

Regards, Max

stefan_grube
Active Contributor
0 Kudos

The XMLAnonymizerBean always creates a XML declaration with an apostrophe instead of quote.

You cannot do anything here.

Is there no way to enhance the receiver of the message to handle standard XML files?

former_member187339
Active Contributor
0 Kudos

Hi Max,

Then i will suggest you to use a XSLT mapping after XMLAnnonimyzer Bean call.

Check this blog for how to make an XSLT call from communication channel

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417600%29ID0802704450DB0007723325786448049...

And you can use this code for getting the double quotes in the output


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet> 

Regards

Suraj