当前位置: 首页>>代码示例>>PHP>>正文


PHP QtiComponent::getXml方法代码示例

本文整理汇总了PHP中qtism\data\QtiComponent::getXml方法的典型用法代码示例。如果您正苦于以下问题:PHP QtiComponent::getXml方法的具体用法?PHP QtiComponent::getXml怎么用?PHP QtiComponent::getXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtism\data\QtiComponent的用法示例。


在下文中一共展示了QtiComponent::getXml方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: appendChildren

 protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
 {
     try {
         $dom = $component->getXml();
         $node = $fragment->ownerDocument->importNode($dom->documentElement, true);
         $fragment->appendChild($node);
     } catch (RuntimeException $e) {
         $msg = "An error occured while rendering the XML content of the '" . $component->getQtiClassName() . "' external component.";
         throw new RenderingException($msg, RenderingException::UNKNOWN, $e);
     }
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:11,代码来源:ExternalQtiComponentRenderer.php

示例2: appendChildren

 protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
 {
     try {
         $dom = $component->getXml();
         $node = $fragment->ownerDocument->importNode($dom->documentElement, true);
         $node = Utils::anonimizeElement($node);
         $node->setAttribute('xmlns', 'http://www.w3.org/1998/Math/MathML');
         $fragment->appendChild($node);
     } catch (RuntimeException $e) {
         $msg = "An error occured while rendering the XML content of the 'MathML' external component.";
         throw new RenderingException($msg, RenderingException::UNKNOWN, $e);
     }
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:13,代码来源:MathRenderer.php

示例3: appendChildren

 /**
  * @see \qtism\runtime\rendering\markup\xhtml\ExternalQtiComponentRenderer::appendChildren()
  */
 protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
 {
     try {
         $dom = $component->getXml();
         $node = $fragment->ownerDocument->importNode($dom->documentElement, true);
         $nodeNamespaceUri = $node->namespaceURI;
         $node = Utils::anonimizeElement($node);
         if ($this->mustNamespaceOutput() === true) {
             $node->setAttribute('xmlns', $nodeNamespaceUri);
         }
         $fragment->appendChild($node);
     } catch (RuntimeException $e) {
         $msg = "An error occured while rendering the XML content of the 'MathML' external component.";
         throw new RenderingException($msg, RenderingException::UNKNOWN, $e);
     }
 }
开发者ID:nagyist,项目名称:qti-sdk,代码行数:19,代码来源:MathRenderer.php

示例4: marshallChildrenKnown

 /**
  * @see \qtism\data\storage\xml\marshalling\RecursiveMarshaller::marshallChildrenKnown()
  */
 protected function marshallChildrenKnown(QtiComponent $component, array $elements)
 {
     $element = self::getDOMCradle()->createElement($component->getQtiClassName());
     foreach ($elements as $elt) {
         $element->appendChild($elt);
     }
     if ($component instanceof CustomOperator) {
         if ($component->hasClass() === true) {
             self::setDOMElementAttribute($element, 'class', $component->getClass());
         }
         if ($component->hasDefinition() === true) {
             self::setDOMElementAttribute($element, 'definition', $component->getDefinition());
         }
         // Now, we have to extract the LAX content of the custom operator and put it into
         // what we are putting out. (It is possible to have no LAX content at all, it is not mandatory).
         $xml = $component->getXml();
         $operatorElt = $xml->documentElement->cloneNode(true);
         $qtiOperatorElts = self::getChildElementsByTagName($operatorElt, array_merge(self::getOperators(), self::getExpressions()));
         foreach ($qtiOperatorElts as $qtiOperatorElt) {
             $operatorElt->removeChild($qtiOperatorElt);
         }
         Utils::importChildNodes($operatorElt, $element);
         Utils::importAttributes($operatorElt, $element);
     }
     return $element;
 }
开发者ID:nagyist,项目名称:qti-sdk,代码行数:29,代码来源:OperatorMarshaller.php

示例5: marshall

 /**
  * Marshall a Math object into a DOMElement object.
  * 
  * @param QtiComponent $component A Math object.
  * @return DOMElement The according DOMElement object.
  * @throws MarshallingException
  */
 protected function marshall(QtiComponent $component)
 {
     return self::getDOMCradle()->importNode($component->getXml()->documentElement, true);
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:11,代码来源:MathMarshaller.php


注:本文中的qtism\data\QtiComponent::getXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。