php - Guzzle Services - Generating an XML element with an attribute and value -
i'm using guzzle services build xml request based on given data. i'm having problems generating tag attribute , single value. example:
<foo bar="some value">some other value</foo> i can generate tag multiple attributes , no value this:
<foo bar="some value" baz="some other value" /> by using following service description:
'parameters' => [ 'foo' => [ 'location' => 'xml', 'type' => 'object', 'properties' => [ 'bar' => [ 'location' => 'xml', 'type' => 'string', 'data' => ['xmlattribute' => true] ], 'baz' => [ 'location' => 'xml', 'type' => 'string', 'data' => ['xmlattribute' => true] ] ] ] ] or can generate tag single attribute , value that's nested inside tag, this:
<foo bar="some value"> <baz>some other value</baz> </foo> by using following service description:
'parameters' => [ 'foo' => [ 'location' => 'xml', 'type' => 'object', 'properties' => [ 'bar' => [ 'location' => 'xml', 'type' => 'string', 'data' => ['xmlattribute' => true] ], 'baz' => [ 'location' => 'xml', 'type' => "string', ] ] ] ] but doesn't seem there's way generate tag this:
<foo bar="some value">some other value</foo> is possible?
Comments
Post a Comment