soulcutter / saxerator

A SAX-based XML parser for parsing large files into manageable chunks
MIT License
128 stars 19 forks source link

Child elements mixed with text #67

Closed doublestranded closed 4 years ago

doublestranded commented 5 years ago

Hello and thank you for this useful gem! I’ve been parsing XML files from a third party source and found that sometimes parent elements can contain children being a combination of text and node elements. Sometimes the text wraps the elements, so the order of the children would matter. I believe this is both well-formed and valid XML. The issue for me is that Saxerator does not yet handle these cases.

I’ve submitted a PR demonstrating what’s worked for me so far. In particular, I would like to maintain to order of string text in relation to sibling elements. Please let me know if this works for Saxerator. I would be happy to make any adjustments. Thank you!

soulcutter commented 4 years ago

Wow, it's been a spell since I've dusted this off, but I like where you're going with this change. I'm going to see if I can work this in, even though I expect your need may have passed since it's been a year. Thanks for this contribution!

doublestranded commented 4 years ago

Thank you @soulcutter! I am still interested in this change, and I'm glad you like where it's going. Please let me know if you need anything further.

soulcutter commented 4 years ago

Thanks for this! I've released a new official version that includes your changes.

doublestranded commented 4 years ago

Thank you @soulcutter! I look forward to incorporating the new release in my work.