We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have feed:
<?xml version="1.0" encoding="UTF-8"?> <SHOP> <SHOPITEM id="392"> <NAME>Andělika obrovská</NAME> <GUID>575c1bb4-710a-11eb-b3db-0cc47a6c9370</GUID> <SHORT_DESCRIPTION><![CDATA[<p>Výška sazenice cca 20 cm</p>]]></SHORT_DESCRIPTION> </SHOPITEM> </SHOP>
I need to parse it and then render it.
I would like to ask your advice on how to render "SHORT_DESCRIPTION" as CDATA.
$reader = $service->getReader(); $reader->xml(file_get_contents($feedUrl)); $xml = $reader->parse(); //bdump($xml); $writer = $service->getWriter(); $writer->openMemory(); $writer->setIndent(true); $writer->startDocument('1.0', 'UTF-8'); $writer->namespaceMap[''] = ''; $writer->write($xml); //bdump($writer->outputMemory());
Can you please add the code to my sample?
The text was updated successfully, but these errors were encountered:
Why do you need it? It's almost always a mistake.
Sorry, something went wrong.
Because the "SHORT_DESCRIPTION" element contains HTML code that consists of "<" and ">" characters.
Element must be rendered as "CDATA". It is a mandatory requirement for importing feed in the e-shop platform shoptet.cz.
It's much better to map those to < ad >. If your e-shop platform requires it, they use a broken xml parser which would be very surprising!
<
>
No branches or pull requests
I have feed:
I need to parse it and then render it.
I would like to ask your advice on how to render "SHORT_DESCRIPTION" as CDATA.
Can you please add the code to my sample?
The text was updated successfully, but these errors were encountered: