mtext_serialize(3m17n)
β¨ mtext_serialize β the m17n library's lil XML glow-up for your text properties π
okay bestie, welcome to mtext_serialize(3m17n) from The m17n Library π pull up a chair, we're about to turn your fancy text properties into XML and honestly? it's giving archival queen π
πΈ NAME πΈ
mtext_serialize β serialize text properties in an M-text β¨
π¦ SYNOPSIS π¦
MText* mtext_serialize (MText * mt, int from, int to, MPlist *
property_list)
π DESCRIPTION π
okay so the whole vibe here is: serialize text properties in an M-text. that's the tea. π΅
The mtext_serialize() function serializes the text between from and to in the M-text mt. and the result? an M-text in the form of XML bestie, we're fancy now π
property_list is the bouncer at the club πͺ β it limits which text properties get serialized. Only those text properties whose key does BOTH of these get in:
- appears as the value of an element in
property_list, and - has the symbol property
#Mtext_prop_serializer
...and only those get serialized as a "property" element in the resulting XML representation. no invite, no entry, periodt π
π The DTD of the generated XML π
here's the whole fit, exactly as it comes out:
<!DOCTYPE mtext [
<!ELEMENT mtext (property*,body+)>
<!ELEMENT property EMPTY>
<!ELEMENT body (#PCDATA)>
<!ATTLIST property key CDATA #REQUIRED>
<!ATTLIST property value CDATA #REQUIRED>
<!ATTLIST property from CDATA #REQUIRED>
<!ATTLIST property to CDATA #REQUIRED>
<!ATTLIST property control CDATA #REQUIRED>
]>
π¨ ok real talk for a sec bestie: this function depends on the libxml2 library. If the m17n library is configured without libxml2, this function always fails. no libxml2, no XML. it's that simple π
β Return value β
if everything slayed: mtext_serialize() returns an M-text in the form of XML π
if not: it returns NULL and assigns an error code to the external variable #merror_code. sad girl hours π
π«Ά See Also π«Ά
mtext_deserialize()β the reverse glow-up π#Mtext_prop_serializerβ the symbol that decides who gets serialized π
π COPYRIGHT π
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page bestie, no cap π this was Version 1.8.4, dated Mon Sep 25 2023, and it lives under the name mtext_serialize(3m17n) β mwah, go forth and serialize, ily π¦β¨π
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms