Skip to main content
Participant
March 24, 2010
Answered

error on SDK 4.1.0.14965: TextConverter.importToFlow not accepting a Configuration

  • March 24, 2010
  • 1 reply
  • 975 views

Hello

I got a sudden error when updating my SDK to 4.1.0.14965 that is just out. The error is just that TextConverter.importToFlow is not creating the TextFlow, it is returning null, thus the rest of my code gets crashed.

I tried to isolate the error as far as I could and here is the status:

- everything worked fine till SDK 4.1.0.14883

- the TextFlow was not created when the source had an <a> tag (not sure if it happens with other tags) (it does work fine if the source has no extra tags)

- TextFlow was created fine if I didn't pass a Configuration (even with an <a> tag in the source)

So my guess is that there is some new changes to the Configuration, specially in the link format part, but I could not find anything else that would guide me to solve that. I looked in the TLF release notes, source code, Language Reference and nothing!!

Would anyone guess how to solve that?? Was there indeed any update in the TLF source in that section? Is that a bug?

This is my importToFlow use:

__tflow = TextConverter.importToFlow(__xml.toXMLString(), TextConverter.TEXT_LAYOUT_FORMAT, sprd.config);

. TLF formated XML source
. TextConverter.TEXT_LAYOUT_FORMAT as format
. a Configuration settings
thanks a lot!!
andré

This topic has been closed for replies.
Correct answer

You may be running into an integration error I heard about today. The Flex 4.1 project is picking up a new TLF 1.1 build, but the first integration did not work (the TLF build number was incremented, but not the version number). Could you try backing up to 4.1.0.14865 to see if that fixes your problem?

1 reply

Adobe Employee
March 24, 2010

You might learn something by checking the errors.

            var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
            importer.importToFlow(_xml);     // no need to make it into a String - in fact TLF just makes it back into XML
            for each (var str:String in importer.errors)
                trace(str);

Posting a small AS source file that can be compiled and demonstrates the bug would be very useful.

Thanks,

Richard

Participant
March 24, 2010

Thanks Richard

First thanks for the tip of not needing to convert the XML to String, I had no clue : )

My error was Unexpected namespace!

But Unexpected namespace?? That's sure unexpected.. All my source XML have the attribute xmlns set by hand to xmlns="http://ns.adobe.com/textLayout/2008". So I just tried to set the namespace with xml.setNamespace("http://ns.adobe.com/textLayout/2008"); and it didn't RTE anymore. But I got some extra problems here, my website was 490kb size and now is 170Kb!

Well I will keep working on it and update this page.

That would be the correct way to set TextLayout's namespace right? xml.setNamespace("http://ns.adobe.com/textLayout/2008"); ??

Thanks again richard

Correct answer
March 24, 2010

You may be running into an integration error I heard about today. The Flex 4.1 project is picking up a new TLF 1.1 build, but the first integration did not work (the TLF build number was incremented, but not the version number). Could you try backing up to 4.1.0.14865 to see if that fixes your problem?