-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andreas Pakulat wrote:
On 06.03.06 15:54:01, Kasimier Buchcik wrote:
This is due to QNames in attribute/element content. QNames need a corresponding ns-prefix to be in scope; thus Libxml2 tries to avoid automatic renaming of prefixes.
Now I'm not too familiar with the specs, but does ":" in element content need escaping? If not, then how can you distinguish a string content containing ":" at some point from a QName as element content, if you don't have an XML Schema at hand that tells you?
This is exactly the problem: the tree modification functions do not know where you intended to use QNames, so currently the only robust way to keep the correct prefix for a QName in scope, is to avoid modifiying prefixes of ns-declarations by QName-in-text-content ignorant mechanisms.
I guess these modification function cannot use a xml schema document that is references by the xml document? If they could, you could say: All element content that is not an element itself is a string, which would be OK with the XML spec, AFAIK. This way you would either know (from the schema) that the content is a QName (or can contain one) or treat it as simple text.
Frankly, I think QNames in element text / attribute values are such a rare edge case that they could be neglected; making the namespace-compacting stuff an option leaves them "safe", while still allowing the dominant case to clean up nicely. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEDKXP+gerLs4ltQ4RAibQAKC+ZdVGHbHvgFuWm00MNGNelWGgCgCgrqkd utSo2Umwp+f90jH4GzixUlE= =opUL -----END PGP SIGNATURE-----