Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: XML checks fail if less than character < is inside a string value #721

Closed
mstovenour opened this issue Apr 20, 2024 · 4 comments

Comments

@mstovenour
Copy link
Contributor

I have existing scenario files that are modeled directly out of the documentation:
https://sipp.readthedocs.io/en/latest/scenarios/variables.html?highlight=search_in#variables

<recv request="INVITE">
  <action>
    <ereg regexp="<sip:([^;@]*)" search_in="hdr" header="To:" assign_to="dummy,uri" />
  </action>
</recv>
<Reference variables="dummy" />

The less than character < inside the quotes of the regexp tag (regexp="<sip:([^;@]*)") causes the following failure when running with any release after v3.6.0:
2024-04-20 12:55:46.344095 1713635746.344095: Invalid XML in scenario

Existing scenario files work fine up until v3.5.3. They will not pass the XML check logic starting with v3.6.0.

I'm pretty sure this commit introduced the regression:
411ccf4 @wdoekes

It might be the deletion of this function call as the xp_find_start_tag_end() function is checking for embedded strings in quotes "".
image

@mstovenour
Copy link
Contributor Author

This looks like a duplicate of #670

@wdoekes
Copy link
Member

wdoekes commented Apr 21, 2024

Which in turn looks like a duplicate of #414

But if the documentation wrongly advises ="<..." then that should be fixed.

@mstovenour
Copy link
Contributor Author

mstovenour commented Apr 22, 2024

I see the conversation in #414 and I'll concede that SIPp previously supported invalid XML syntax, but it did so for two decades; yes I'm old. I think this would have taken me a lot less time if SIPp were to implement the following changes:

  • Change documentation so it doesn't suggest incorrect language (pull request coming)
  • Change error message so it clearly calls out the regression to give future me a hint (pull request coming)
  • Add line number counting while parsing XML so this syntax check can explicitly state the line number (can you meet half way and help with this one?)

@mstovenour
Copy link
Contributor Author

I just submitted a pull request for my suggestion to yet more notes for future me.

wdoekes added a commit that referenced this issue Apr 29, 2024
Suggested and reviewed by Michael Stovenour (@mstovenour).
Closes: #721 (along with #725)
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

No branches or pull requests

2 participants