Skip to content

XML special characters in setting values break production definition generation #13

Description

@reet0512
  • iris kit details: 'any — issue is in the Python code generator'
  • operating system: 'any'
  • python version: 'any'
  • error message: 'IRIS compilation error on the generated production class due to invalid XML'

Steps to Reproduce:

  1. Define a ServiceItem/ProcessItem/OperationItem with a setting value containing &, <, >, or "
  2. Run the code generator

Minimal Example

from intersystems_pyprod import Production, ServiceItem

class MyProduction(Production):
    services = [
        ServiceItem(
            "MyService",
            "EnsLib.File.PassthroughService",
            adapter_settings={
                "FilePath": "/data/input&output",
            },
        )
    ]

Expected Behaviour

The value is XML-escaped (&amp;) in the generated <Setting> element.

Actual Behaviour

Raw & is interpolated, producing invalid XML that fails to compile on IRIS side.

Additional Information

Root cause: _production_definition.py:_create_item_target_settings uses f-string
interpolation with no escaping. Same applies to item attributes (name, comment, schedule)
in _create_production_item.

Related to #6 (same category of unescaped interpolation into generated code).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions