Can I parse the XHTML generated by XStandard using an XML parser?
Yes, markup generated by XStandard is easily parsable by XML technologies like DOM parser and XSLT. Since XStandard is a content editor, the markup it generates is an XML fragment without a root element. So, before you load this markup into an XML parser, you need to add the root element yourself.
Here is a Visual Basic 6 example:
Dim objDoc As MSXML2.DOMDocument40
Set objDoc = New MSXML2.DOMDocument40
objDoc.async = False
objDoc.loadXML "<root>" & XHTMLEditor1.Value & "</root>"
MsgBox objDoc.xml
Set objDoc = Nothing
Here is the same example in C#:
using System.Xml;
- ...
XmlDocument doc = new XmlDocument();
XmlNamespaceManager namespaceManager = new XmlNamespaceManager(doc.NameTable);
doc.LoadXml("<root>" + axXHTMLEditor1.Value + "</root>");
MessageBox.Show(doc.InnerXml.ToString());