Re: updating namespace prefix of QName

Jan Pokorný via xml <[email protected]> Mon, 2 Sep 2019 22:32:09 +0200
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
On 29/08/19 14:31 -0700, Eric Eberhard wrote:
> In these weird cases - and I have a few - if you have the
> performance for your task, just load it as is (or as you created)
> then write to disk.

I don't have any trick for the problem original poster raised,
but whenever possible, I'd recommend against any "disk grounded"
round-trips.

> Have a small C program change it.  Reload it.  Tacky but always
> works.  Simple too.

Assuming the whole logic leveraging libxml2 can share the same
program, it can be turned into:

- dump to buffer (e.g. xmlDocDumpFormatMemory)
- do something with buffer (e.g. string replacement)
- read buffer back (e.g. xmlReadDoc)
- continue as if the original DOM was used
  (forget about using previously stored references to the original
  DOM for any identity checking purposes, amongst other Don'ts...)

> Slightly less performance which if that matters is a bad idea.
> I have found that on new machines performance is not an issue.

-- 
Jan (Poki)

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJdbXxJAAoJEGG7sjqej43imFkQAL73/Zs87T4eJQR1WH2NOiVT
MJkscs2uXeo/w3ImmCt5ZtdsVFegGfLGxWK+stcpKey1NYcI/NKhRJTaXmmlr6dj
v3ge/QSkm+wkY9Kn1aoPLkHx6tckbT/fNauagOsr5pzJT/m99q6e73jyPQc05xj/
LQ24k5bl0NAnqaWk4PBSktwMIyBCKinSI1hxg6MG7BPEC9WCDqiTOiolRoskZO+x
LmvVDn4hbmqjOfTTfolgnRqIiR/HRLAY7EjBJg9APxDlPWqc3bOZhRZWjIMpDN6v
/qMS0We5IbwapeQaQn3CN6YvMITR0GDzIfmkXlUhSmbvX8UDFXp7WkH5THFVvDFf
EMWNT58ZoBmwHfI+VImi58FA6Tbdb3P39k3Ef26ARhm+lTWjE3+yN1r65q58SeKD
1VB71yoiHs0NU6wCqZ2anlGcajqCLidrG5ErziQrsMqps5OoCo4NGPeb++ucRyQF
HbVbPoSDvXq50VTnhhhmFBxyilEdP7PppNQtwx97JoJiNuiL1hQUseKappw002Kj
h8ioQvEN6lO9K82UQ0e9ZPE6cLe1yh+aRsACKfmj3pq0BxPCWovbAfdp4SoHsWiO
oQ2/BQbuIOXfdzfmVpOYTtscQbMahDvLndCQWjx+4VqTwOELok71oOnJ+5CrW+7N
Z9WlDSVpjLFzP2R+/Dii
=63Yg
-----END PGP SIGNATURE-----