Skip to content

Fix parameter value parsing, expression evaluation and the graphviz test fixture - #21

Open
Ghesselink wants to merge 2 commits into
support-4.x-graphviz-format-2from
support-4.x-graphviz-format-3
Open

Fix parameter value parsing, expression evaluation and the graphviz test fixture#21
Ghesselink wants to merge 2 commits into
support-4.x-graphviz-format-2from
support-4.x-graphviz-format-3

Conversation

@Ghesselink

Copy link
Copy Markdown
Collaborator

No description provided.

@aothms

aothms commented Aug 23, 2026

Copy link
Copy Markdown
Member

mvdXML parameters are frequently unquoted identifiers or namespaced

codes, e.g. ContextType=Model or CRSName[Value]=EPSG:5555.

Curious to understand what you have been testing with. There isn't a really clear spec for mvdxml, but quoted strings should be the bare minimum I guess..?

@Ghesselink
Ghesselink requested a review from aothms August 23, 2026 16:15
@Ghesselink

Copy link
Copy Markdown
Collaborator Author

@aothms

Curious to understand what you have been testing with. There isn't a really clear spec
for mvdxml, but quoted strings should be the bare minimum I guess..?

I'd think so too, it comes from the ReferenceView_V1-2.mvdxml

<TemplateRule Parameters="RelatingType=IfcActuatorType;" />

It doesn't seem like an exception

>>> from xml.dom.minidom import parse
>>> doc = parse("mvd_examples/officials/ReferenceView_V1-2.mvdxml")
>>> print([r.attributes["Parameters"].value for r in doc.getElementsByTagNameNS("*", "TemplateRule")][:5])
['RelatingType=IfcActuatorType;', 'PsetName=Pset_ActuatorTypeCommon;', 'PsetName=Pset_ActuatorTypeLinearActuation;', 'PsetName=Pset_ActuatorTypeRotationalActuation;', 'QsetName=Qto_ActuatorBaseQuantities;']

Each of those raises an error in ast.literal_eval(),. It's not an exception it seems, doing a quick check: across the 421
TemplateRule elements there are 436 comparison values and none of them is quoted.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants