cancel
Showing results for 
Search instead for 
Did you mean: 

XML output file error while opening

former_member183906
Active Contributor
0 Kudos

Hi,

I have scenario file to file.

The output file is generated successfully and name is ABC.xml.

I am using SAP standard SWCV - HR-XML and its components like service interface etc. These are uneditable objects and the namespace is

<ns0:PositionOpening xmlns:ns0="http://ns.hr-xml.org/2004-08-02" xml:lang="EN">

When i am opening generated ABC.xml the error comes as -

The namespace prefix is not allowed to start with the reserved string "xml". Error processing resource 'file:///C:/Users/dv...

Can you please help in it.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi SAP PI,

                     This XML is not giving me any errors

<?xml version="1.0"?>

<ns0:PositionOpening xmlns:ns0="http://ns.hr-xml.org/2004-08-02" xml:lang="EN">

   <Book>

      <ns0:Title>hello</ns0:Title>

      <ISBN>SCN</ISBN>

   </Book>

</ns0:PositionOpening>

The error you mentioned is possible if you use the "xml" keyword (in any combination of uppercase or lowercase letters) in user-defined namespace prefixes in an XML document. For example this one

<?xml version="1.0"?>

<country xmlns:xmlabc="whoseNamespace">

   <a>

      <xmlabc:capital></xmlabc:capital>

      <xmlabc:city></xmlabc:city>

   </a>

</country>

Please check if in other part of xml , if there is word XML in namespace prefixes.

Need to remove or replace the namespace prefixes using java mapping or xslt mapping.

Regards

Anupam

former_member183906
Active Contributor
0 Kudos

Hi Anupam,

xmlns:xml="http://www.w3.org/XML/1998/namespace"

this is used multiple times in my xml.

below is the thing :

how can i remove it from XML generated by XI,as its the output of XI,i can not remove it manually.

Can you try this and let me know :

</ns0:FormattedPositionDescription><ns0:FormattedPositionDescription xmlns:ns0="http://ns.hr-xml.org/2004-08-02"><ns0:Name xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="Industryhttp://ns.hr-xml.org/2004-08-02">Industry</ns0:Name><ns0:Value xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="Tokehttp://ns.hr-xml.org/2004-08-02">Toke</ns0:Value></ns0:FormattedPositionDescription><ns0:Formatt... xmlns:ns0="http://ns.hr-xml.org/2004-08-02"><ns0:Name xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="WorkContractTypehttp://ns.hr-xml.org/2004-08-02">WorkContractType</ns0:Name><ns0:Value xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="Tokehttp://ns.hr-xml.org/2004-08-02">Toke</ns0:Value></ns0:FormattedPositionDescription><ns0:Formatt... xmlns:ns0="http://ns.hr-xml.org/2004-08-02"><ns0:Name xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="nullhttp://ns.hr-xml.org/2004-08-02">null</ns0:Name><ns0:Value xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="http://ns.hr-xml.org/2004-08-02" xml:lang="EN">String 10</ns0:Value></ns0:FormattedPositionDescription><ns0:FormattedPositionDescription xmlns:ns0="http://ns.hr-xml.org/2004-08-02"><ns0:Name xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="nullhttp://ns.hr-xml.org/2004-08-02">null</ns0:Name><ns0:Value xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="String" _mce_href="http://ns.hr-xml.org/2004-08-02">String">http://ns.hr-xml.org/2004-08-02">String 12</ns0:Value></ns0:FormattedPositionDescription>

Regards

Former Member
0 Kudos

Please check this link and configure anonymizer.acceptNamespaces parameter.

http://scn.sap.com/thread/3152346

Otherwise you may use xslt mapping also.

Regards,

Beena.

anupam_ghosh2
Active Contributor
0 Kudos

Hi SAP PI,

               Please try  Beena's suggestion.

In case still you face problems , you can try java or XSLT mapping.

Regards

Anupam

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am not sure but do you have

xmlns:xml="http://www.w3.org/XML/1998/namespace" defined in xml document? Just remove it and try once.

Regards,

Beena.

former_member183906
Active Contributor
0 Kudos

Hi Beena.

<ns0:PositionOpening xmlns:ns0="http://ns.hr-xml.org/2004-08-02" xml:lang="EN">

<ns0:FormattedPositionDescription xmlns:ns0="http://ns.hr-xml.org/2004-08-02"><ns0:Name xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="Industryhttp://ns.hr-xml.org/2004-08-02">Industry</ns0:Name><ns0:Value xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ns0="Tokehttp://ns.hr-xml.org/2004-08-02">Toke</ns0:Value></ns0:FormattedPositionDescription>

These namespaces i see here..

How can i remove and replace it..

Regards

Former Member
0 Kudos

Hi,

Please check this link which says:

http://www.w3.org/TR/2006/REC-xml-names-20060816/

The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared, and MUST NOT be bound to any other namespace name. Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace.

So its not required to declare this namespace. Just remove it and see if it works on local machine.

You may use xmlanonymizer bean to remove the namespace in PI.

Regards,

Beena.