Skip to main content
Participant
June 3, 2009
Question

SelectionManager xml generation

  • June 3, 2009
  • 1 reply
  • 579 views

I am having an issue where when doing a deepCopy on my textFlow, it is not copying all the data.  I have not yet been able to narrow this down just yet into a reproducible case for a bug report (is there a known issue?  It used to happen with textscraps in the past and still happens to me occasionally when exporting as TextFilter.PLAIN_TEXT_FORMAT, but the data is there in the TEXT_LAYOUT_FORMAT).   However, because of this, I have switched to just exporting the text in the text layout format and creating the String myself.  The xml that is generated contains spaces and newlines correctly.  They are not escaped or surrounded by CDATA, thus when putting them into an XML object you lose all the extra whitespace.  Would it be possible to wrap these things that would be stripped by the XML object?

Also, the SelectionManager documentation (from build 442) contains an example on how to copy text, however it uses text scraps and these appear to have been removed at least in the latest builds (442).

Thanks!

-Kevin

This topic has been closed for replies.

1 reply

Adobe Employee
June 3, 2009

There aren't any known problems with deepCopy or the exporter dropping actual content.  An example of the bug would be really useful.

Whitespace should be preservable when creating XML.  I'm not sure where its getting lost in your case.  Check out the XML.ignoreWhitespace property it defaults to true and you may want false.  Another thing to do is when constructing the TextFlow node set the whiteSpaceCollapse property to "preserve".  It defaults to "collapse".

Hope that helps,

Richard

kwk12345Author
Participant
June 3, 2009

The ignoreWhitespace worked great.  Sorry for posting such a basic question here.  I will try to come up with an example for what I am getting on the export.

Thanks