Import assets from xml


(Alderman) #1

Hi.

 

We are attempting to export from our current cms into Squiz xml format then import as assets into Squiz.  We have the correct format for the actions and assets are created and metadata and Squiz fields are populated correctly except where those fields are wysiwyg.

 

Even though the set metadata action value contains all the html from our current cms and is packaged in CDATA tags the Squiz import only imports parts of these fields.  For example a simple anchor seems to be enough to cause the import to discard everything from the anchor and above.  Ampersands seem to do the same and even a humble semi-colon.

 

If we strip all html from these fields during our export the field survives intact (but format-less as plain text - one big string)

 

Any ideas?

 

Jeff.


(Nic Hubbard) #2

What version?


(Anthony Barnes) #3

You could try using the export tool on an asset in Matrix that contains wysiwyg content, then match the way the exporter formats it. If that can be re-imported correctly then it stands to reason your migrated content should import.


(David Schoen) #4

Metadata fields are stored internally with special escaping around equals ("=") symbols which would be in the attribute definition of the achor tag I suspect.

 

In your Matrix install, have a look in core/assets/metadata/metadata_field/metadata_field.inc for the encodeValueString() function, if possible, pass your value through here before storing it in the XML to see if that helps.


(Alderman) #5

Thanks for all the help guys - we are on Squiz 5.0.2.0


(Alderman) #6

Escaping equals signs and semi-colons seems to work (that's what the Squiz export did).  Can anyone think of any other chars that might need escaping?