c# - XML processing instructions not appearing in the prolog -
c# - XML processing instructions not appearing in the prolog -
i have c# programme generates xml application. taking attribute values of these xml tags , attempting display them in formatted table using xslt. have been able stylesheet(xsl) reference appear in xml document, appears @ bottom hence displaying original xml. how can processing instruction tag appear right after declaration? snippet puts processing instruction @ bottom of xml doc.
xmlprocessinginstruction newpi; string pitext = "type='text/xsl' href='stylesheet.xsl'"; newpi = b.createprocessinginstruction("xml-stylesheet", pitext); b.appendchild(newpi);
if additional info needed please allow me know , appreciate input.
thanks
use b.insertbefore(newpi, b.documentelement)
.
c# xml xslt
Comments
Post a Comment