Closed SebastianStehle closed 2 years ago
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 :)
Afaik the normal xml is totally valid.
But in this case I have no idea how to get the inner xml.