PyXmlContentTransformerBase
class PyXmlContentTransformerBase
Bases: Generic
[TPublish
]
Generic base class for XML transformers.
__init__()
Methods
__init__ () |
|
---|---|
needs_xml_transforming (ctx) |
Finds whether the content item needs any XML changes, returning false prevents file IO from occurring. |
transform (ctx, xml) |
Transforms the XML of the content item. |
needs_xml_transforming(ctx)
Finds whether the content item needs any XML changes, returning false prevents file IO from occurring.
Args: : ctx: The content item to inspect.
Returns: Whether or not the content item needs XML changes.
- Parameters: ctx (TPublish)
- Return type: bool
transform(ctx, xml)
Transforms the XML of the content item.
Args: : ctx: The content item being transformed. xml: The XML of the content item to transform. Any changes made to the XML are persisted back to the file before publishing.
- Parameters:
- ctx (TPublish)
- xml (Element)
- Return type: None