Porting from 4Suite & Amara1 to Amara2

See also: Amara/Developer_notes/Test_migration

XSLT

See Amara/Architecture

For a purely mechanical conversion of imports here are some guidelines

#OLD:
from Ft.Xml.Xslt import XsltElement, XsltException, Error, XSL_NAMESPACE
#NEW:
from amara.xslt import XsltError
from amara.xslt.elements import xsltelement
from amara.namespaces import XSL_NAMESPACE

{i} Ft.Xml.Xslt.XsltException and Ft.Xml.Xslt.Error are combined into the single class amara.xslt.XsltError.

#OLD:
from Ft.Xml.Xslt import CategoryTypes  #No longer needed
from Ft.Xml.Xslt import ContentInfo, AttributeInfo
from Ft.Xml.XPath import Conversions #Not really needed any more?
#NEW:
from amara.xslt import contentinfo, attributeinfo

Also:

Please remove the old top file header comments and replace them with the new Amara2 convention.

########################################################################
# amara/path/to/file.py

Rename files and classes to meet the new conventions. It's OK to leave the files in the old directory structure, but update the names and imports. E.g. Ft/Xml/Xslt/ApplyImportsElement.py is renamed apply_imports.py and the class in that file renamed apply_imports_element. You would write an import of that class as:

from amara.xslt.elements.applyimports import apply_imports_element

Amara/Developer_notes/Porting (last edited 2010-12-03 17:56:34 by LuisMiguel)