Feature Request: Support for mixed content
SebastianStehle opened this issue · 7 comments
Afaik the normal xml is totally valid.
<div>
<strong>Hello</strong> U8XMLParser
</div>
But in this case I have no idea how to get the inner xml.
- InnerText is empty.
- AsRawXml returns everything including the div
- Looping over XmlNodes returns only the strong node, but not a text node or so.
Thank you for the report.
I did not consider nodes that have both nodes and text in their child elements.
The parser implementation needs to be corrected.
Great work btw. As I said in the other issue we are working on a MJML port and this library gives us a 20% performance speed. OR would give us...
Btw: Do you also support comments?
@SebastianStehle
The parser skips comments, so you can't get any information in it.
But you can parse it by yourself from the string XmlObject.AsRawString()
or XmlNode.AsRawString()
methods return.
I have special "raw" nodes and for these raw nodes I just need to print the output directly. Something like
<mj-raw>
<!-- Comment -->
<hr />
Foobar
</mj-raw>
If I can somehow get the inner content it works fine for me.
Try out the following code.
XmlNode mj_raw = ...; // <mj-raw> node
RawString str = mj_raw.AsRawString();
Console.WriteLine(str);
The output is
<mj-raw>
<!-- Comment -->
<hr />
Foobar
</mj-raw>
Is this what you want ?
If you want to get the content of mj-raw
node, you should slice the RawString
.
Awesome :)