<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QXmlStreamWriter: How to create complex xml header ?]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I want to create the following complex xml header with QXmlStreamWriter:<br />
@<br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;?xml-stylesheet href="./AutoValidationRepport_HTML_Transformation.xsl" type="text/xsl" ?&gt;<br />
&lt;AutomaticValidation xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:noNamespaceSchemaLocation="file:./AutoValidationRepportSchema.xsd"&gt;<br />
@</p>
<p dir="auto">To create the first line, I could call <em>writeStartDocument()</em>, but for the rest I cannot find any info how to create it ?</p>
<p dir="auto">Could you please advise on this issue ?</p>
<p dir="auto">Many thannks in advance !</p>
]]></description><link>https://forum.qt.io/topic/25955/qxmlstreamwriter-how-to-create-complex-xml-header</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 03:34:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/25955.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Apr 2013 10:21:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QXmlStreamWriter: How to create complex xml header ? on Sun, 07 Apr 2013 14:54:15 GMT]]></title><description><![CDATA[<p dir="auto">thank s lot</p>
]]></description><link>https://forum.qt.io/post/172847</link><guid isPermaLink="true">https://forum.qt.io/post/172847</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sun, 07 Apr 2013 14:54:15 GMT</pubDate></item><item><title><![CDATA[Reply to QXmlStreamWriter: How to create complex xml header ? on Sun, 07 Apr 2013 14:13:03 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
QByteArray data;<br />
QString namespaceUri = "<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.w3.org/2001/XMLSchema-instance</a>";</p>
<p dir="auto">QXmlStreamWriter w(&amp;data);<br />
w.setCodec("UTF-8"); //this is redundant, but that's how you set encoding<br />
w.writeStartDocument();<br />
w.writeProcessingInstruction("xml-stylesheet", "href="./AutoValidationRepport_HTML_Transformation.xsl" type="text/xsl"");</p>
<p dir="auto">w.writeStartElement("AutomaticValidation");<br />
w.writeNamespace(namespaceUri, "xsi");<br />
w.writeAttribute(namespaceUri, "noNamespaceSchemaLocation", "file:./AutoValidationRepportSchema.xsd");<br />
...<br />
w.writeEndElement();<br />
w.writeEndDocument();@</p>
]]></description><link>https://forum.qt.io/post/172836</link><guid isPermaLink="true">https://forum.qt.io/post/172836</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Sun, 07 Apr 2013 14:13:03 GMT</pubDate></item></channel></rss>