struct its_node_list_ty nodes;
};
+/* Copies an element node and its attributes, but not its children nodes,
+ for inserting at a sibling position in the document tree. */
+static xmlNode *
+_its_copy_node_with_attributes (xmlNode *node)
+{
+ xmlNode *copy;
+
+#if 0
+ /* Not suitable here, because it adds namespace declaration attributes,
+ which is overkill here. */
+ copy = xmlCopyNode (node, 2);
+#elif 0
+ /* Not suitable here either, for the same reason. */
+ copy = xmlNewNode (node->ns, node->name);
+ copy->properties = xmlCopyPropList (copy, node->properties);
+#else
+ copy = xmlNewNode (node->ns, node->name);
+
+ xmlAttr *attributes;
+ for (attributes = node->properties;
+ attributes != NULL;
+ attributes = attributes->next)
+ {
+ const xmlChar *attr_name = attributes->name;
+ if (strcmp ((const char *) attr_name, "id") != 0)
+ {
+ xmlNs *attr_ns = attributes->ns;
+ xmlChar *attr_value = xmlGetNsProp (node, attr_name, attr_ns->href);
+ xmlNewNsProp (copy, attr_ns, attr_name, attr_value);
+ xmlFree (attr_value);
+ }
+ }
+#endif
+
+ return copy;
+}
+
/* Returns true if S starts with a character reference. */
static bool
starts_with_character_reference (const char *s)
{
xmlNode *translated;
- translated = xmlNewNode (node->ns, node->name);
+ /* Create a new element node, of the same name, with the same
+ attributes. */
+ translated = _its_copy_node_with_attributes (node);
+
xmlSetProp (translated, BAD_CAST "xml:lang", BAD_CAST language);
/* libxml2 offers two functions for setting the content of an
as ©,
or as ©?
</p>
- <p xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
+ <p gt:escape="yes" xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
<p>Written by &author1;, &author2;, and &author3;.</p>
<p xml:lang="fr">Écrit par &author1;, &author2;, et &author3;.</p>
<p gt:escape="no">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
+ <p gt:escape="no" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
<p gt:escape="yes">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
+ <p gt:escape="yes" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
</description>
<url type="homepage">https://wiki.gnome.org/Design/Apps/CharacterMap</url>
<updatecontact>dueno_at_src.gnome.org</updatecontact>
as &#169;,
or as &copy;?
</p>
- <p xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
- <p xml:lang="de">Wussten Sie, dass das Copyright-Zeichen (©, U+00A9) in HTML als &#xa9;, als &#169;, oder als &copy; geschrieben werden kann?</p>
+ <p gt:escape="yes" xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
+ <p gt:escape="yes" xml:lang="de">Wussten Sie, dass das Copyright-Zeichen (©, U+00A9) in HTML als &#xa9;, als &#169;, oder als &copy; geschrieben werden kann?</p>
<p>Written by &author1;, &author2;, and &author3;.</p>
<p xml:lang="fr">Écrit par &author1;, &author2;, et &author3;.</p>
<p xml:lang="de">Geschrieben von &author1;, &author2; und &author3;.</p>
<p gt:escape="no">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
- <p xml:lang="de">Escape-Beispiele: Operator x&y, Standard-XML Entitäten & " ' & < >, Zeichen ©, escaptes Zeichen &#xa9;, Entitäten © &author1;</p>
+ <p gt:escape="no" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
+ <p gt:escape="no" xml:lang="de">Escape-Beispiele: Operator x&y, Standard-XML Entitäten & " ' & < >, Zeichen ©, escaptes Zeichen &#xa9;, Entitäten © &author1;</p>
<p gt:escape="yes">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
- <p xml:lang="de">Escape-Beispiele: Operator x&y, Standard-XML Entitäten & " ' & < >, Zeichen ©, escaptes Zeichen &#xa9;, Entitäten &copy; &author1;</p>
+ <p gt:escape="yes" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
+ <p gt:escape="yes" xml:lang="de">Escape-Beispiele: Operator x&y, Standard-XML Entitäten & " ' & < >, Zeichen ©, escaptes Zeichen &#xa9;, Entitäten &copy; &author1;</p>
</description>
<url type="homepage">https://wiki.gnome.org/Design/Apps/CharacterMap</url>
<updatecontact>dueno_at_src.gnome.org</updatecontact>
as &#169;,
or as &copy;?
</p>
- <p xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
+ <p gt:escape="yes" xml:lang="fr">Saviez-vous que le signe de copyright (©, U+00A9) peut être écrit en HTML comme &#xa9;, comme &#169; ou comme &copy; ?</p>
<p>Written by &author1;, &author2;, and &author3;.</p>
<p xml:lang="fr">Écrit par &author1;, &author2;, et &author3;.</p>
<p gt:escape="no">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
+ <p gt:escape="no" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités © &author1;</p>
<p gt:escape="yes">Escape gallery: operator x&y, standard XML entities & " ' & < >, character reference ©, escaped character reference &#xa9;, entity references © &author1;</p>
- <p xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
+ <p gt:escape="yes" xml:lang="fr">Exposition d'échappements: operateur x&y, entités XML standard & " ' & < >, caractère ©, caractère échappé &#xa9;, entités &copy; &author1;</p>
</description>
<url type="homepage">https://wiki.gnome.org/Design/Apps/CharacterMap</url>
<updatecontact>dueno_at_src.gnome.org</updatecontact>