Hi Paul,
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.
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.
Regards,
Jorge
[1] http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html
On 16/11/21 17:51, Paul Wittle wrote:
Hi,
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.
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?
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.
So I save the project using QGIS and I get:
<qgis projectname=”” saveDateTime=”” saveUser=”” version=””
saveUserFull=””>
Someone else saves it on their device using QGIS and we get:
<qgis projectname=”” saveUser=”” saveUserFull=”” version=””
saveDateTime=””>
Is this expected as I would have thought that QGIS would have kept
this consistent?
The version is "3.16.0-Hannover" for all the users.
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?
Any tips would be appreciated but if it is too technical a question
they my apologises.
Paul
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
www.dorsetcouncil.gov.uk/data-protection
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user