xml icon indicating copy to clipboard operation
xml copied to clipboard

Trouble with prefix in writer

Open vrobin95 opened this issue 5 years ago • 0 comments

Hi,

I am tring to get the next configuration, without any prefix:

<GetValuation xmlns="http://www.eurotax.com/webservices/">

According to the documentation I wrote:

$writer->write([
      '{http://www.eurotax.com/webservices/}GetValuation' => $parameters
]);
//result: <x1:GetValuation xmlns:x1="http://www.eurotax.com/webservices/">

So, I added the next configuration:

$this->sabreService->namespaceMap['http://www.eurotax.com/webservices/'] =  '';

And here is the result I got:

<GetValuation>

What am I doing wrong ? Thank you for your help


edit: The next configuration seems strange too:

$this->sabreService->namespaceMap['http://www.eurotax.com/webservices/'] =  'test';
//with the same $writer as previously
$writer->write([
      '{http://www.eurotax.com/webservices/}GetValuation' => $parameters
]);

It removes the xmlns attribute and gives me:

<test:GetValuation>

vrobin95 avatar Jun 10 '20 15:06 vrobin95