1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
\subsection{printxml}
\label{labprintxml}
\noindent Name: \textbf{printxml}\\
\phantom{aaa}prints an expression as an MathML-Content-Tree\\[0.2cm]
\noindent Library names:\\
\verb| void sollya_lib_printxml(sollya_obj_t)|\\
\verb| void sollya_lib_printxml_newfile(sollya_obj_t, sollya_obj_t)|\\
\verb| void sollya_lib_printxml_appendfile(sollya_obj_t, sollya_obj_t)|\\[0.2cm]
\noindent Usage:
\begin{center}
\textbf{printxml}(\emph{expr}) : \textsf{function} $\rightarrow$ \textsf{void}\\
\textbf{printxml}(\emph{expr}) $>$ \emph{filename} : (\textsf{function}, \textsf{string}) $\rightarrow$ \textsf{void}\\
\textbf{printxml}(\emph{expr}) $>$ $>$ \emph{filename} : (\textsf{function}, \textsf{string}) $\rightarrow$ \textsf{void}\\
\end{center}
Parameters:
\begin{itemize}
\item \emph{expr} represents a functional expression
\item \emph{filename} represents a character sequence indicating a file name
\end{itemize}
\noindent Description: \begin{itemize}
\item \textbf{printxml}(\emph{expr}) prints the functional expression \emph{expr} as a tree of
MathML Content Definition Markups. This XML tree can be re-read in
external tools or by usage of the \textbf{readxml} command.
If a second argument \emph{filename} is given after a single $>$, the
MathML tree is not output on the standard output of \sollya but if in
the file \emph{filename} that get newly created or overwritten. If a double
$>$ $>$ is given, the output will be appended to the file \emph{filename}.
\end{itemize}
\noindent Example 1:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> printxml(x + 2 + exp(sin(x)));
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by sollya: http://sollya.org/ -->
<!-- syntax: printxml(...); example: printxml(x^2-2*x+5); -->
<?xml-stylesheet type="text/xsl" href="http://sollya.org/mathmlc2p-web.xsl"?>
<?xml-stylesheet type="text/xsl" href="mathmlc2p-web.xsl"?>
<!-- This stylesheet allows direct web browsing of MathML-c XML files (http:// o
r file://) -->
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<annotation-xml encoding="MathML-Content">
<lambda>
<bvar><ci> x </ci></bvar>
<apply>
<apply>
<plus/>
<apply>
<plus/>
<ci> x </ci>
<cn type="integer" base="10"> 2 </cn>
</apply>
<apply>
<exp/>
<apply>
<sin/>
<ci> x </ci>
</apply>
</apply>
</apply>
</apply>
</lambda>
</annotation-xml>
<annotation encoding="sollya/text">(x + 1b1) + exp(sin(x))</annotation>
</semantics>
</math>
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> printxml(x + 2 + exp(sin(x))) > "foo.xml";
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> printxml(x + 2 + exp(sin(x))) >> "foo.xml";
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{readxml} (\ref{labreadxml}), \textbf{print} (\ref{labprint}), \textbf{write} (\ref{labwrite})
|