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

Does not handle new lines in tags #39

Open
fineless71 opened this issue Jul 23, 2023 · 2 comments
Open

Does not handle new lines in tags #39

fineless71 opened this issue Jul 23, 2023 · 2 comments

Comments

@fineless71
Copy link

fineless71 commented Jul 23, 2023

Hi, I'm trying to parse an svg, and I'm getting an error:

xml_parser_error at 10:22: xml_parse_node::tag missmatch
xml_parser_error at 11:0 (is  ): xml_parse_node::child
xml_parser_error at 10:22: xml_parse_document::parsing document failed

From reading other issues, I've tried removing the header, removing comments, replacing spaces, and replacing single tags (/>)

Here's the file:

<svg
   width="210mm"
   height="297mm"
   viewBox="0&#032;0&#032;210&#032;297"
   version="1.1"
   id="svg5"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs2"></defs>
  <rect
     style="fill:none;stroke:#000000;stroke-width:10;stroke-linejoin:round;paint-order:stroke&#032;fill&#032;markers"
     id="rect896"
     width="100.21762"
     height="58.545967"
     x="30.625204"
     y="89.954025"></rect>
  <rect
     style="fill:#006aff;stroke:#000000;stroke-width:10;stroke-linejoin:round;paint-order:stroke&#032;fill&#032;markers;fill-opacity:1"
     id="rect898"
     width="68.958168"
     height="53.455563"
     x="83.309692"
     y="224.85725"></rect>
</svg>
@fineless71
Copy link
Author

Found the issue, this library doesn't support tags being multiple lines. Any chance for this to be fixed, or is this not supported?

@fineless71 fineless71 changed the title xml_parse_node::tag missmatch Does not handle new lines in tags Jul 23, 2023
@ooxi
Copy link
Owner

ooxi commented Jul 25, 2023

@fineless71 thank you for the report! This most likely has to be implemented in xml_find_attributes. Unlike the rest of the code, this does not use recursive descent and has a couple of issues, like not supporting whitespace in attributes.

It's not likely that I'll find time to work on this any time soon, but I'm happy accepting patches.

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