.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "LaTeXML::Common::Model 3pm" .TH LaTeXML::Common::Model 3pm "2014-03-18" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" "LaTeXML::Common::Model" \- represents the Document Model .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`LaTeXML::Common::Model\*(C'\fR encapsulates information about the document model to be used in converting a digested document into \s-1XML\s0 by the LaTeXML::Core::Document. This information is based on the document schema (eg, \s-1DTD,\s0 RelaxNG), but is also modified by package modules; thus the model may not be complete until digestion is completed. .PP The kinds of information that is relevant is 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. .PP 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. .PP It extends LaTeXML::Common::Object. .SS "Model Creation" .IX Subsection "Model Creation" .ie n .IP """$model = LaTeXML::Common::Model\->new(%options);""" 4 .el .IP "\f(CW$model = LaTeXML::Common::Model\->new(%options);\fR" 4 .IX Item "$model = LaTeXML::Common::Model->new(%options);" Creates a new model. The only useful option is \&\f(CW\*(C`permissive=>1\*(C'\fR which ignores any \s-1DTD\s0 and allows the document to be built without following any particular content model. .SS "Document Type" .IX Subsection "Document Type" .ie n .IP """$model\->setDocType($rootname,$publicid,$systemid,%namespaces);""" 4 .el .IP "\f(CW$model\->setDocType($rootname,$publicid,$systemid,%namespaces);\fR" 4 .IX Item "$model->setDocType($rootname,$publicid,$systemid,%namespaces);" Declares the expected rootelement, the public and system \s-1ID\s0's of the document type to be used in the final document. The hash \f(CW%namespaces\fR specifies the namespace prefixes that are expected to be found in the \s-1DTD,\s0 along with the associated namespace \s-1URI. \s0 These prefixes may be different from the prefixes used in implementation code (eg. in ltxml files; see RegisterNamespace). The generated document will use the namespaces and prefixes defined here. .SS "Namespaces" .IX Subsection "Namespaces" Note that there are \fItwo\fR 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 \f(CW\*(C`ltx\*(C'\fR is used consistently to refer to LaTeXML's own namespace (\f(CW\*(C`http://dlmf.nist.gov/LaTeXML)\*(C'\fR. .PP 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. .ie n .IP """$model\->registerNamespace($prefix,$namespace_url);""" 4 .el .IP "\f(CW$model\->registerNamespace($prefix,$namespace_url);\fR" 4 .IX Item "$model->registerNamespace($prefix,$namespace_url);" Register \f(CW$prefix\fR to stand for the namespace \f(CW$namespace_url\fR. This prefix can then be used to create nodes in constructors and Document methods. It will also be recognized in XPath expressions. .ie n .IP """$model\->getNamespacePrefix($namespace,$forattribute,$probe);""" 4 .el .IP "\f(CW$model\->getNamespacePrefix($namespace,$forattribute,$probe);\fR" 4 .IX Item "$model->getNamespacePrefix($namespace,$forattribute,$probe);" Return the prefix to use for the given \f(CW$namespace\fR. If \f(CW$forattribute\fR is nonzero, then it looks up the prefix as appropriate for attributes. If \f(CW$probe\fR is nonzero, it only probes for the prefix, without creating a missing entry. .ie n .IP """$model\->getNamespace($prefix,$probe);""" 4 .el .IP "\f(CW$model\->getNamespace($prefix,$probe);\fR" 4 .IX Item "$model->getNamespace($prefix,$probe);" Return the namespace url for the given \f(CW$prefix\fR. .SS "Model queries" .IX Subsection "Model queries" .ie n .IP """$boole = $model\->canContain($tag,$childtag);""" 2 .el .IP "\f(CW$boole = $model\->canContain($tag,$childtag);\fR" 2 .IX Item "$boole = $model->canContain($tag,$childtag);" Returns whether an element with qualified name \f(CW$tag\fR can contain an element with qualified name \f(CW$childtag\fR. The tag names #PCDATA, #Document, #Comment and #ProcessingInstruction are specially recognized. .ie n .IP """$boole = $model\->canHaveAttribute($tag,$attribute);""" 2 .el .IP "\f(CW$boole = $model\->canHaveAttribute($tag,$attribute);\fR" 2 .IX Item "$boole = $model->canHaveAttribute($tag,$attribute);" Returns whether an element with qualified name \f(CW$tag\fR is allowed to have an attribute with the given name. .SH "SEE ALSO" .IX Header "SEE ALSO" LaTeXML::Common::Model::DTD, LaTeXML::Common::Model::RelaxNG. .SH "AUTHOR" .IX Header "AUTHOR" Bruce Miller .SH "COPYRIGHT" .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the \s-1US.\s0