Creates a new <col> element that represents an anonymous column
@param doc the document
@return the new element
973538
public static Element createAnonymousColumn(Document doc)
    {
        Element div = doc.createElement("col");
        div.setAttribute("class", "Xanonymous");
        div.setAttribute("style", "display:table-column;");
        return div;
    }
535722
def _create_window_function(name, doc=''):
    
    def _():
        sc = SparkContext._active_spark_context
        jc = getattr(sc._jvm.functions, name)()
        return Column(jc)
    _.__name__ = name
    _.__doc__ = 'Window function: ' + doc
    return _
246781
Document createDocument(Entity entity) {
    int maxIndexingDepth = entity.getEntityType().getIndexingDepth();
    XContentBuilder contentBuilder;
    try {
      contentBuilder = XContentFactory.contentBuilder(JSON);
      XContentGenerator generator = contentBuilder.generator();
      generator.writeStartObject();
      createRec(entity, generator, 0, maxIndexingDepth);
      generator.writeEndObject();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    String documentId = toElasticsearchId(entity.getIdValue());
    return Document.create(documentId, contentBuilder);
  }
359247
public static Document createDOMDocument()
    {
        try {
            return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        } catch (ParserConfigurationException ex) {
            LOGGER.error("Cannot create DOM Documents", ex);
            return null;
        }
    }
75900
private synchronized Document asXmlDocument() throws IOException {
    Document doc;
    try {
      doc =
        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    } catch (ParserConfigurationException pe) {
      throw new IOException(pe);
    }
    Element conf = doc.createElement("configuration");
    doc.appendChild(conf);
    conf.appendChild(doc.createTextNode("\n"));
    handleDeprecation(); //ensure properties is set and deprecation is handled
    for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) {
      String name = (String)e.nextElement();
      Object object = properties.get(name);
      String value = null;
      if (object instanceof String) {
        value = (String) object;
      }else {
        continue;
      }
      Element propNode = doc.createElement("property");
      conf.appendChild(propNode);

      Element nameNode = doc.createElement("name");
      nameNode.appendChild(doc.createTextNode(name));
      propNode.appendChild(nameNode);

      Element valueNode = doc.createElement("value");
      valueNode.appendChild(doc.createTextNode(value));
      propNode.appendChild(valueNode);

      if (updatingResource != null) {
        String[] sources = updatingResource.get(name);
        if(sources != null) {
          for(String s : sources) {
            Element sourceNode = doc.createElement("source");
            sourceNode.appendChild(doc.createTextNode(s));
            propNode.appendChild(sourceNode);
          }
        }
      }

      conf.appendChild(doc.createTextNode("\n"));
    }
    return doc;
  }
584742
public void nextColumn() throws DocumentException {
        currentColumn = (currentColumn + 1) % columnDefs.size();
        top = nextY;
        if (currentColumn == 0) {
            newPage();
        }
    }
619787
public function insert($col, $doc = [], $cb = null, $params = [])
    {
        if (mb_orig_strpos($col, '.') === false) {
            $col = $this->dbname . '.' . $col;
        }

        if (!isset($doc['_id'])) {
            $doc['_id'] = new \MongoId;
        }
        if ($this->safeMode) {
            static::safeModeEnc($doc);
        }
        try {
            $this->request(
                self::OP_INSERT,
                "\x00\x00\x00\x00" . $col . "\x00" . bson_encode($doc),
                false,
                null,
                function ($conn, $reqId = null) use ($cb, $col, $params) {
                    if ($cb !== null) {
                        $this->lastError($col, $cb, $params, $conn);
                    }
                }
            );

            return $doc['_id'];
        } catch (\MongoException $e) {
            Daemon::log('MongoClient exception: ' . $e->getMessage() . ': ' . $e->getTraceAsString());
            if ($cb !== null) {
                if ($cb !== null) {
                    $cb(['$err' => $e->getMessage(), '$doc' => $doc]);
                }
            }
        }
    }
942452
public Document createDOM(PDDocument doc) throws IOException
    {
        /* We call the original PDFTextStripper.writeText but nothing should
           be printed actually because our processing methods produce no output.
           They create the DOM structures instead */
        super.writeText(doc, new OutputStreamWriter(System.out));
        return this.doc;
    }
737678
public JTextField createFilterTextField(int columnIndex)
    {
        while (textFields.size() - 1 < columnIndex)
        {
            textFields.add(null);
        }
        JTextField textField = new JTextField();
        textFields.set(columnIndex, textField);
        
        Document document = textField.getDocument();
        document.addDocumentListener(new DocumentListener()
        {
            @Override
            public void removeUpdate(DocumentEvent e)
            {
                updateFilter();
            }
            
            @Override
            public void insertUpdate(DocumentEvent e)
            {
                updateFilter();
            }
            
            @Override
            public void changedUpdate(DocumentEvent e)
            {
                updateFilter();
            }
        });
        return textField;
    }
1084830
public Element makeStyleElement(Document document) {
    Element style = SVGUtil.makeStyleElement(document);
    updateStyleElement(document, style);
    return style;
  }
119098
private Document insertDocument(EntityKeyMetadata entityKeyMetadata, Tuple tuple, TupleContext tupleContext ) {
		Document dbObject = objectForInsert( tuple, ( (MongoDBTupleSnapshot) tuple.getSnapshot() ).getDbObject() );
		getCollection( entityKeyMetadata.getTable(), tupleContext.getTupleTypeContext().getOptionsContext() ).insertOne( dbObject );
		return dbObject;
	}
1174136
def create_document(doc) #:nodoc:
      http_response = call_server(:method => :post, :uri => "document/#{@database}", \
          :content_type => 'application/json', :data => doc.to_json)
      resp = process_response(http_response) do
        raise DataError, 'validation problem' if http_response.body =~ /OValidationException/
      end

      resp = ::JSON.parse(http_response.body) # workaround: https://groups.google.com/forum/?fromgroups=#!topic/orient-database/UJGAXYpHDmo
      resp.extend Orientdb4r::DocumentMetadata
      resp
    end
392062
public static Node addChildNode(Document doc, Node parentNode, String childName, String childValue){
                if(doc == null || parentNode == null || childName == null){
                        return null;
                }
                Node childNode = doc.createElement(childName);
                if(childValue != null){
                        childNode.setTextContent(childValue);
                }
                parentNode.appendChild(childNode);
                return childNode;
        }
318109
protected static Document createDocument(String document) throws PolicyIndexException {

        // parse policy document and create dom
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder;
        try {
            builder = factory.newDocumentBuilder();
            Document doc = builder.parse(new InputSource(new StringReader(document)));
            return doc;
        } catch (ParserConfigurationException e) {
            throw new PolicyIndexException(e);
        } catch (SAXException e) {
            throw new PolicyIndexException(e);
        } catch (IOException e) {
            throw new PolicyIndexException(e);
        }
    }
472618
function (doc) {
    var self = this;
    var id = doc._id;
    if (self._published.has(id))
      throw Error("tried to add something already published " + id);
    if (self._limit && self._unpublishedBuffer.has(id))
      throw Error("tried to add something already existed in buffer " + id);

    var limit = self._limit;
    var comparator = self._comparator;
    var maxPublished = (limit && self._published.size() > 0) ?
      self._published.get(self._published.maxElementId()) : null;
    var maxBuffered = (limit && self._unpublishedBuffer.size() > 0) ?
      self._unpublishedBuffer.get(self._unpublishedBuffer.maxElementId()) : null;
    // The query is unlimited or didn't publish enough documents yet or the new
    // document would fit into published set pushing the maximum element out,
    // then we need to publish the doc.
    var toPublish = ! limit || self._published.size() < limit ||
                    comparator(doc, maxPublished) < 0;

    // Otherwise we might need to buffer it (only in case of limited query).
    // Buffering is allowed if the buffer is not filled up yet and all matching
    // docs are either in the published set or in the buffer.
    var canAppendToBuffer = !toPublish && self._safeAppendToBuffer &&
                            self._unpublishedBuffer.size() < limit;

    // Or if it is small enough to be safely inserted to the middle or the
    // beginning of the buffer.
    var canInsertIntoBuffer = !toPublish && maxBuffered &&
                              comparator(doc, maxBuffered) <= 0;

    var toBuffer = canAppendToBuffer || canInsertIntoBuffer;

    if (toPublish) {
      self._addPublished(id, doc);
    } else if (toBuffer) {
      self._addBuffered(id, doc);
    } else {
      // dropping it and not saving to the cache
      self._safeAppendToBuffer = false;
    }
  }
982853
def _create_function(name, doc=""):
    
    def _(col):
        spark_ctx = SparkContext._active_spark_context
        java_ctx = (getattr(spark_ctx._jvm.com.sparklingpandas.functions,
                            name)
                    (col._java_ctx if isinstance(col, Column) else col))
        return Column(java_ctx)
    _.__name__ = name
    _.__doc__ = doc
    return _
826103
final Document createDocument(List<String> row, DocumentFactory documentFactory) {
    String id = StringUtils.EMPTY;
    String content = StringUtils.EMPTY;
    Language language = documentFactory.getDefaultLanguage();
    Map<AttributeType, Object> attributeMap = new HashMap<>();

    String idField = Config.get(configProperty, "idField").asString("ID").toUpperCase();
    String contentField = Config.get(configProperty, "contentField").asString("CONTENT").toUpperCase();
    String languageField = Config.get(configProperty, "languageField").asString("LANGUAGE").toUpperCase();
    Index<String> fields = getFieldNames();

    for (int i = 0; i < row.size() && i < fieldNames.size(); i++) {
      String field = row.get(i);
      String fieldName = fields.get(i);
      if (idField.equalsIgnoreCase(fieldName)) {
        id = field;
      } else if (contentField.equalsIgnoreCase(fieldName)) {
        content = field;
      } else if (languageField.equalsIgnoreCase(fieldName)) {
        language = Language.fromString(field);
      } else {
        AttributeType attributeType = AttributeType.create(fieldName);
        attributeMap.put(attributeType, attributeType.getValueType().decode(field));
      }
    }
    return documentFactory.create(id, content, language, attributeMap);
  }