<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Paul,</p>
    <p>1) I use pg_services. I just change one link (to the desired
      pg_services.conf file) to change between prod and dev layers. I
      don't have to change the QGIS project.</p>
    <p>2) To find/replace parts of any XML file, I use the old
      xmlstarlet command line tool. Using such tools, the order of the
      attributes is irrelevant.</p>
    <p>Regards,</p>
    <p>Jorge<br>
    </p>
    <p>[1] <a class="moz-txt-link-freetext" href="http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html">http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html</a><br>
    </p>
    <div class="moz-cite-prefix">On 16/11/21 17:51, Paul Wittle wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:LO2P265MB323117041D1DB10B6B83791DC1999@LO2P265MB3231.GBRP265.PROD.OUTLOOK.COM">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I know people will probably ask “why?” in
          relation to this question but I’ve got a Powershell script
          that I use to create copies of some QGIS projects because I
          want to change the data source of a couple of layers between
          dev and test. Rather than do this in QGIS it is done as part
          of an automation hence using Powershell; I’ve had mixed
          results trying to load the QGIS project standalone and so
          Powershell felt simpler.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Anyway; the issue I’m getting is that
          Powershell is adding a space between the last />. So
          <title/> will become <title />. Is there a way to
          set QGIS so that the project files are saved with the spaces?
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The other issue I’m getting is that the
          attributes in the elements seem to be moving depending on who
          saves it. This is when using QGIS; not Powershell.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">So I save the project using QGIS and I get:<o:p></o:p></p>
        <p class="MsoNormal"><qgis projectname=”” saveDateTime=””
          saveUser=”” version=”” saveUserFull=””><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Someone else saves it on their device using
          QGIS and we get:<o:p></o:p></p>
        <p class="MsoNormal"><qgis projectname=”” saveUser=””
          saveUserFull=”” version=”” saveDateTime=””><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Is this expected as I would have thought
          that QGIS would have kept this consistent?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The version is <span
            style="font-size:10.5pt;font-family:"Segoe
            UI",sans-serif;color:#242424;background:#E9EAF6">
            "3.16.0-Hannover"</span> for all the users.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The reason I’m asking is that the files are
          in source control and given it is XML I would have expected it
          to be easy to identify what someone changed but due to the
          issues above it tends to claim that almost everything was
          changed. This is just because all the attributes are reordered
          and the spaces are being added to the end of elements as well.
          I can live with it but I thought I’d ask if there is a setting
          I can use that will ensure that projects save consistently
          really?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Any tips would be appreciated but if it is
          too technical a question they my apologises.<o:p></o:p></p>
        <p class="MsoNormal">Paul <o:p></o:p></p>
      </div>
      This e-mail and any files transmitted with it are intended solely
      for the use of the individual or entity to whom they are
      addressed. It may contain unclassified but sensitive or
      protectively marked material and should be handled accordingly.
      Unless you are the named addressee (or authorised to receive it
      for the addressee) you may not copy or use it, or disclose it to
      anyone else. If you have received this transmission in error
      please notify the sender immediately. All traffic may be subject
      to recording and/or monitoring in accordance with relevant
      legislation. Any views expressed in this message are those of the
      individual sender, except where the sender specifies and with
      authority, states them to be the views of Dorset Council. Dorset
      Council does not accept service of documents by fax or other
      electronic means. Virus checking: Whilst all reasonable steps have
      been taken to ensure that this electronic communication and its
      attachments whether encoded, encrypted or otherwise supplied are
      free from computer viruses, Dorset Council accepts no liability in
      respect of any loss, cost, damage or expense suffered as a result
      of accessing this message or any of its attachments. For
      information on how Dorset Council processes your information,
      please see <a class="moz-txt-link-abbreviated" href="http://www.dorsetcouncil.gov.uk/data-protection">www.dorsetcouncil.gov.uk/data-protection</a>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
    </blockquote>
  </body>
</html>