Remove empty tag from XML
-
Hi!
Im trying to remove tag from XML file if data is empty using your code as example:
function my_output_param_color( $value ) { $xml = ''; if ( ! empty( $value ) ) { $xml .= '**LT**ProductColor**GT**' . $value . '**LT**/ProductColor**GT**'; } return $xml; }Example usage in the XML template:
[my_output_param_color({Product Color})]Everything is working fine, if i only use one function, than tag, one function, than tag ..
Example:
[my_output_param_color({Product Color})] <Title>{Title}</Title> [my_output_param_bluetooth({Product BLUETOOTH})] <ShortDescription>{Short Description}</ShortDescription>but im getting an “An unknown error occurred” if i try to use one function after another
Example:
[my_output_param_color({Product Color})] [my_output_param_bluetooth({Product BLUETOOTH})]CDATA is turned off.
Thank you for your help!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Remove empty tag from XML’ is closed to new replies.