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


Java DTM.CDATA_SECTION_NODE属性代码示例

本文整理汇总了Java中org.apache.xml.dtm.DTM.CDATA_SECTION_NODE属性的典型用法代码示例。如果您正苦于以下问题:Java DTM.CDATA_SECTION_NODE属性的具体用法?Java DTM.CDATA_SECTION_NODE怎么用?Java DTM.CDATA_SECTION_NODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.xml.dtm.DTM的用法示例。


在下文中一共展示了DTM.CDATA_SECTION_NODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHead

/**
 * Get the head of the most likely list of associations to check, based on 
 * the name and type of the targetNode argument.
 *
 * @param xctxt The XPath runtime context.
 * @param targetNode The target node that will be checked for a match.
 * @param dtm The dtm owner for the target node.
 *
 * @return The head of a linked list that contains all possible match pattern to 
 * template associations.
 */
public TemplateSubPatternAssociation getHead(XPathContext xctxt, 
                                             int targetNode, DTM dtm)
{
  short targetNodeType = dtm.getNodeType(targetNode);
  TemplateSubPatternAssociation head;

  switch (targetNodeType)
  {
  case DTM.ELEMENT_NODE :
  case DTM.ATTRIBUTE_NODE :
    head = (TemplateSubPatternAssociation) m_patternTable.get(
      dtm.getLocalName(targetNode));
    break;
  case DTM.TEXT_NODE :
  case DTM.CDATA_SECTION_NODE :
    head = m_textPatterns;
    break;
  case DTM.ENTITY_REFERENCE_NODE :
  case DTM.ENTITY_NODE :
    head = (TemplateSubPatternAssociation) m_patternTable.get(
      dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
    break;
  case DTM.PROCESSING_INSTRUCTION_NODE :
    head = (TemplateSubPatternAssociation) m_patternTable.get(
      dtm.getLocalName(targetNode));
    break;
  case DTM.COMMENT_NODE :
    head = m_commentPatterns;
    break;
  case DTM.DOCUMENT_NODE :
  case DTM.DOCUMENT_FRAGMENT_NODE :
    head = m_docPatterns;
    break;
  case DTM.NOTATION_NODE :
  default :
    head = (TemplateSubPatternAssociation) m_patternTable.get(
      dtm.getNodeName(targetNode)); // %REVIEW% I think this is right
  }

  return (null == head) ? m_wildCardPatterns : head;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:52,代码来源:TemplateList.java

示例2: endNode

/**
 * End processing of given node 
 *
 *
 * @param node Node we just finished processing
 *
 * @throws org.xml.sax.SAXException
 */
protected void endNode(int node) throws org.xml.sax.SAXException
{

  switch (m_dtm.getNodeType(node))
  {
  case DTM.DOCUMENT_NODE :
    this.m_contentHandler.endDocument();
    break;
  case DTM.ELEMENT_NODE :
    String ns = m_dtm.getNamespaceURI(node);
    if(null == ns)
      ns = "";
    this.m_contentHandler.endElement(ns,
                                       m_dtm.getLocalName(node),
                                       m_dtm.getNodeName(node));

    for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn;
         nsn = m_dtm.getNextNamespaceNode(node, nsn, true))
    {
      // String prefix = m_dtm.getPrefix(nsn);
      String prefix = m_dtm.getNodeNameX(nsn);

      this.m_contentHandler.endPrefixMapping(prefix);
    }
    break;
  case DTM.CDATA_SECTION_NODE :
    break;
  case DTM.ENTITY_REFERENCE_NODE :
  {
    if (m_contentHandler instanceof LexicalHandler)
    {
      LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);

      lh.endEntity(m_dtm.getNodeName(node));
    }
  }
  break;
  default :
  }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:48,代码来源:DTMTreeWalker.java

示例3: getNodeTypeTest

/**
 * Tell what node type to test, if not DTMFilter.SHOW_ALL.
 *
 * @param whatToShow Bit set defined mainly by 
 *        {@link org.apache.xml.dtm.DTMFilter}.
 * @return the node type for the whatToShow.  Since whatToShow can specify 
 *         multiple types, it will return the first bit tested that is on, 
 *         so the caller of this function should take care that this is 
 *         the function they really want to call.  If none of the known bits
 *         are set, this function will return zero.
 */
public static int getNodeTypeTest(int whatToShow)
{
  // %REVIEW% Is there a better way?
  if (0 != (whatToShow & DTMFilter.SHOW_ELEMENT))
    return DTM.ELEMENT_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_ATTRIBUTE))
    return DTM.ATTRIBUTE_NODE;
    
  if (0 != (whatToShow & DTMFilter.SHOW_TEXT))
    return DTM.TEXT_NODE;
    
  if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT))
    return DTM.DOCUMENT_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_FRAGMENT))
    return DTM.DOCUMENT_FRAGMENT_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_NAMESPACE))
    return DTM.NAMESPACE_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_COMMENT))
    return DTM.COMMENT_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_PROCESSING_INSTRUCTION))
    return DTM.PROCESSING_INSTRUCTION_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_DOCUMENT_TYPE))
    return DTM.DOCUMENT_TYPE_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_ENTITY))
    return DTM.ENTITY_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_ENTITY_REFERENCE))
    return DTM.ENTITY_REFERENCE_NODE;

  if (0 != (whatToShow & DTMFilter.SHOW_NOTATION))
    return DTM.NOTATION_NODE;
    
  if (0 != (whatToShow & DTMFilter.SHOW_CDATA_SECTION))
    return DTM.CDATA_SECTION_NODE;


  return 0;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:56,代码来源:NodeTest.java


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