mtext_serialize(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 (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