Idf Parser

The IdfBodyParser offers an easy way to parse and manage the content of an idf-tag.

First, make sure the \Infomaker\Everyware\NewsML\NewsMLTransformerManager is set up with the needed parsers.

Then you instantiate the class while providing the newsML to be parsed:

use \Infomaker\Everyware\NewsML\IdfBodyParser;

$newsml = '
  <idf>
    <group>
      <object id="MTI3LDE5MCwyMjUsMjA4" type="x-im/image" uuid="2d6ac910-6c0a-51cc-8d4c-fbcf12e250dd">
        <links>
          <link rel="self" type="x-im/image" uri="im://image/RuoKvhPu89C9qYQmsbBvje1uqzU.jpg" 
            uuid="2d6ac910-6c0a-51cc-8d4c-fbcf12e250dd">
            <data>
              <width>800</width>
              <height>534</height>
              <text/>
              <alttext/>
            </data>
          </link>
        </links>
      </object>
    </group>
  </idf>
';

$parser = new IdfBodyParser($newsml);

Last updated