ThomasJSmart
Programmer
- Sep 16, 2002
- 634
Hi
Anyone run into this before?
This outputs:
<content>
<span>this is some</span>xml test</content>
Note the space is gone after "</span>" causing it to visually appear like this: this is somexml test.
How can I prevent tidy from removing that space?
I have little to no control over what is inside of the <content> element and it is dynamic, so it could be any short html sentence with or without html markup.
Cheers
Thomas
site | blog | iphones |
Anyone run into this before?
Code:
$xml= "<content><span>this is some</span> xml test</content>";
$tidy_options = array(
'input-xml' => true,
'output-xml' => true,
'indent' => true,
'wrap' => false,
'show-body-only' => true,
'input-encoding' => mb_detect_encoding($html),
'output-encoding' => 'utf8',
'alt-text' => 'HKMEx',
'show-errors' => 0,
'show-warnings' => 0
);
$tidy = new tidy();
$tidy->parseString($xml, $tidy_options);
$tidy->cleanRepair();
print $tidy;
This outputs:
<content>
<span>this is some</span>xml test</content>
Note the space is gone after "</span>" causing it to visually appear like this: this is somexml test.
How can I prevent tidy from removing that space?
I have little to no control over what is inside of the <content> element and it is dynamic, so it could be any short html sentence with or without html markup.
Cheers
Thomas
site | blog | iphones |