LaTeXML...::Model(3)
β¨ NAME β¨
LaTeXML::Common::Model β represents the Document Model. This is the LaTeXML...::Model(3) page from User Contributed Perl Documentation, bestie π«Ά.
πΈ DESCRIPTION πΈ
LaTeXML::Common::Model encapsulates information about the document model to be used in converting a digested document into XML by the LaTeXML::Core::Document. This info is based on the document schema (eg, DTD, RelaxNG), but itβs also modified by package modules β so heads up: the model may not be complete until digestion is completed. π
The kinds of information that are relevant are not only the content model (what each element can contain contain), but also SGML-like information such as whether an element can be implicitly opened or closed, if needed to insert a new element into the document. iykyk β¨
π¨ Caveat check: currently, only an approximation to the schema is understood and used. For example, we only record that certain elements can appear within another; we donβt preserve any information about required order or number of instances. Itβs giving βvibes-based schema,β lowkey π.
It extends LaTeXML::Common::Object.
π Model Creation π
$model = LaTeXML::Common::Model->new(%options);β Creates a new model. The only useful option ispermissive=>1, which ignores any DTD and allows the document to be built without following any particular content model. permission granted, bestie π
π Document Type π
$model->setDocType($rootname,$publicid,$systemid,%namespaces);β Declares the expected rootelement, the public and system IDβs of the document type to be used in the final document. The hash%namespacesspecifies the namespace prefixes that are expected to be found in the DTD, along with the associated namespace URI. These prefixes may be different from the prefixes used in implementation code (eg. inltxmlfiles; seeRegisterNamespace). The generated document will use the namespaces and prefixes defined here. manifesting the final doc rn β¨
π¦ Namespaces π¦
Note that there are two namespace mappings between namespace URIs and prefixes that are relevant to LaTeXML. The code mapping is the one used in code implementing packages, and in particular, constructors defined within those packages. The prefix ltx is used consistently to refer to LaTeXMLβs own namespace ("http://dlmf.nist.gov/LaTeXML)"). the punctuation is a little unhinged but we move π
The other mapping, the document mapping, is used in the created document; this may be different from the code mapping in order to accommodate DTDs, for example, or for use by other applications that expect a rigid namespace mapping. two maps, two vibes πΊοΈ
$model->registerNamespace($prefix,$namespace_url);β Register$prefixto stand for the namespace$namespace_url. This prefix can then be used to create nodes in constructors and Document methods. It will also be recognized in XPath expressions. πͺ$model->getNamespacePrefix($namespace,$forattribute,$probe);β Return the prefix to use for the given$namespace. If$forattributeis nonzero, then it looks up the prefix as appropriate for attributes. If$probeis nonzero, it only probes for the prefix, without creating a missing entry. look, donβt touch β got it π$model->getNamespace($prefix,$probe);β Return the namespace url for the given$prefix.
π Model queries π
$boole = $model->canContain($tag,$childtag);β Returns whether an element with qualified name$tagcan contain an element with qualified name$childtag. The tag names#PCDATA,#Document,#Commentand#ProcessingInstructionare specially recognized. special-case girlies stay winning β$boole = $model->canHaveAttribute($tag,$attribute);β Returns whether an element with qualified name$tagis allowed to have an attribute with the given name. attribute permission slip: checked π
π SEE ALSO π
LaTeXML::Common::Model::DTD, LaTeXML::Common::Model::RelaxNG.
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov>
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
okay bestie, thatβs the whole page π
β¨ Cute sign-off: source/version is perl v5.42.3, date is 2024-02-26, and the footer says LaTeXML...::Model(3). Bye, love u, go build that document model π«ΆπΈ
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms