Porting from 4Suite & Amara1 to Amara2
See also: Amara/Developer_notes/Test_migration
XSLT
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
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:
All references to Ft.Xml.Xslt.CategoryTypes can be removed as it is currently unused.
Ft.Xml.Xslt.XsltException, Ft.Xml.Xslt.XsltRuntimeError and Ft.Xml.Xslt.Error are all melded into amara.xslt.XsltError
Ft.Xml.Xslt.XsltElement becomes amara.xslt.elements.xsltelement
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
