Create a SVG line element. Do not confuse this with path elements.

@param document document to create in (factory)
@param x1 first point x
@param y1 first point y
@param x2 second point x
@param y2 second point y
@return new element
10166
public static Element svgLine(Document document, double x1, double y1, double x2, double y2) {
    Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG);
    SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1);
    SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1);
    SVGUtil.setAtt(line, SVGConstants.SVG_X2_ATTRIBUTE, x2);
    SVGUtil.setAtt(line, SVGConstants.SVG_Y2_ATTRIBUTE, y2);
    return line;
  }
204929
public Node cloneNode(Document doc, Node eold) {
    return doc.importNode(eold, true);
  }
307644
function( document ){
			var newNode,
				newDocument = null;

			if( this.canCloneDocument( document )){
				newDocument = document.implementation.createHTMLDocument('');
				newNode = newDocument.importNode( document.documentElement, true );
				newDocument.replaceChild(newNode, newDocument.querySelector('html'));
			}
			return (newNode && newNode.nodeType && newNode.nodeType === 1)? newDocument : document;
		}
1309503
function(geometry) {
        var coordinatesNode = this.createElementNS(this.kmlns, "coordinates");
        
        var path;
        var points = geometry.components;
        if(points) {
            // LineString or LinearRing
            var point;
            var numPoints = points.length;
            var parts = new Array(numPoints);
            for(var i=0; i<numPoints; ++i) {
                point = points[i];
                parts[i] = this.buildCoordinates(point);
            }
            path = parts.join(" ");
        } else {
            // Point
            path = this.buildCoordinates(geometry);
        }
        
        var txtNode = this.createTextNode(path);
        coordinatesNode.appendChild(txtNode);
        
        return coordinatesNode;
    }
872591
public Document buildPage(ContentElement content) {
    Document doc = documentBuilder.newDocument();
    Element jcrRoot = createJcrRoot(doc, NT_PAGE);
    Element jcrContent = createJcrContent(doc, jcrRoot, NT_PAGE_CONTENT);

    exportPayload(doc, jcrContent, content);

    return doc;
  }
1339180
def create_element(cls, type_=None, props=None, *children):
        
        # Create an empty document fragment.
        if not type_:
            return cls.dom.create_tag('fragment')

        if props is None:
            props = {}

        # If the first element of children is a list, we use it as the list.
        if len(children) and isinstance(children[0], (list, tuple)):
            children = children[0]

        # The children prop is the first child if there is only one.
        props['children'] = children[0] if len(children) == 1 else children

        if callable(type_):
            # Function component, via def or lambda.
            elt = type_(props)
        else:
            # Raw tag, as a string.
            attributes = {}

            # Never render those attributes on a raw tag.
            props.pop('children', None)
            props.pop('block', None)
            props.pop('blocks', None)
            props.pop('entity', None)
            props.pop('inline_style_range', None)

            # Convert style object to style string, like the DOM would do.
            if 'style' in props and isinstance(props['style'], dict):
                rules = ['{0}: {1};'.format(DOM.camel_to_dash(s), props['style'][s]) for s in props['style'].keys()]
                props['style'] = ''.join(sorted(rules))

            # Convert props to HTML attributes.
            for key in props:
                if props[key] is False:
                    props[key] = 'false'

                if props[key] is True:
                    props[key] = 'true'

                if props[key] is not None:
                    attributes[key] = unicode(props[key])

            elt = cls.dom.create_tag(type_, attributes)

            # Append the children inside the element.
            for child in children:
                if child not in (None, ''):
                    cls.append_child(elt, child)

        # If elt is "empty", create a fragment anyway to add children.
        if elt in (None, ''):
            elt = cls.dom.create_tag('fragment')

        return elt
1312795
public static XPathUtils newXPath(final Document doc) {
        final XPathFactory xpfactory = XPathFactory.newInstance();
        final XPath xPath = xpfactory.newXPath();
        return new XPathUtils(xPath, doc);
    }
1284836
private GraphicsDocument createFeatureDocument(StringWriter writer) throws RenderException {
		if (TileMetadata.PARAM_SVG_RENDERER.equalsIgnoreCase(renderer)) {
			DefaultSvgDocument document = new DefaultSvgDocument(writer, false);
			document.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS);
			document.registerWriter(InternalFeatureImpl.class, new SvgFeatureWriter(getTransformer()));
			document.registerWriter(InternalTileImpl.class, new SvgTileWriter());
			return document;
		} else if (TileMetadata.PARAM_VML_RENDERER.equalsIgnoreCase(renderer)) {
			DefaultVmlDocument document = new DefaultVmlDocument(writer);
			int coordWidth = tile.getScreenWidth();
			int coordHeight = tile.getScreenHeight();
			document.registerWriter(InternalFeatureImpl.class, new VmlFeatureWriter(getTransformer(), coordWidth,
					coordHeight));
			document.registerWriter(InternalTileImpl.class, new VmlTileWriter(coordWidth, coordHeight));
			document.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS);
			return document;
		} else {
			throw new RenderException(ExceptionCode.RENDERER_TYPE_NOT_SUPPORTED, renderer);
		}
	}
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);
  }
937311
public static Element svgWaitIcon(Document document, double x, double y, double w, double h) {
    Element g = SVGUtil.svgElement(document, SVGConstants.SVG_G_TAG);
    setAtt(g, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, "translate(" + x + " " + y + ") scale(" + w + " " + h + ")");
    Element thro = SVGUtil.svgElement(document, SVGConstants.SVG_PATH_TAG);
    setAtt(thro, SVGConstants.SVG_D_ATTRIBUTE, THROBBER_PATH);
    setStyle(thro, THROBBER_STYLE);
    Element anim = SVGUtil.svgElement(document, SVGConstants.SVG_ANIMATE_TRANSFORM_TAG);
    setAtt(anim, SVGConstants.SVG_ATTRIBUTE_NAME_ATTRIBUTE, SVGConstants.SVG_TRANSFORM_ATTRIBUTE);
    setAtt(anim, SVGConstants.SVG_ATTRIBUTE_TYPE_ATTRIBUTE, "XML");
    setAtt(anim, SVGConstants.SVG_TYPE_ATTRIBUTE, SVGConstants.SVG_ROTATE_ATTRIBUTE);
    setAtt(anim, SVGConstants.SVG_FROM_ATTRIBUTE, "0 .5 .5");
    setAtt(anim, SVGConstants.SVG_TO_ATTRIBUTE, "360 .5 .5");
    setAtt(anim, SVGConstants.SVG_BEGIN_ATTRIBUTE, fmt(Math.random() * 2) + "s");
    setAtt(anim, SVGConstants.SVG_DUR_ATTRIBUTE, "2s");
    setAtt(anim, SVGConstants.SVG_REPEAT_COUNT_ATTRIBUTE, "indefinite");
    setAtt(anim, SVGConstants.SVG_FILL_ATTRIBUTE, "freeze");
    thro.appendChild(anim);
    g.appendChild(thro);
    return g;
  }
503715
Document convertSelectorToDocument(Document selector) {
        Document document = new Document();
        for (String key : selector.keySet()) {
            if (key.startsWith("$")) {
                continue;
            }

            Object value = selector.get(key);
            if (!Utils.containsQueryExpression(value)) {
                Utils.changeSubdocumentValue(document, key, value, (AtomicReference<Integer>) null);
            }
        }
        return document;
    }
370796
public void addDocument(Document doc) throws HelloSignException {
        if (doc == null) {
            throw new HelloSignException("Document cannot be null");
        }
        documents.add(doc);
    }
1193808
public static Element svgText(Document document, double x, double y, String text) {
    Element elem = SVGUtil.svgElement(document, SVGConstants.SVG_TEXT_TAG);
    SVGUtil.setAtt(elem, SVGConstants.SVG_X_ATTRIBUTE, x);
    SVGUtil.setAtt(elem, SVGConstants.SVG_Y_ATTRIBUTE, y);
    elem.setTextContent(text);
    return elem;
  }
566113
public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException {
		document.writeElement("path", asChild);
		document.writeAttributeStart("d");
		document.writePathContent(((LineString) o).getCoordinates());
		document.writeAttributeEnd();
	}
623988
function(doc) {
        if (typeof doc == "string") { 
            doc = OpenLayers.Format.XML.prototype.read.apply(this, [doc]);
        }

        var nodes = this.getNodes(doc);
        var ways = this.getWays(doc);
        
        // Geoms will contain at least ways.length entries.
        var feat_list = new Array(ways.length);
        
        for (var i = 0; i < ways.length; i++) {
            // We know the minimal of this one ahead of time. (Could be -1
            // due to areas/polygons)
            var point_list = new Array(ways[i].nodes.length);
            
            var poly = this.isWayArea(ways[i]) ? 1 : 0; 
            for (var j = 0; j < ways[i].nodes.length; j++) {
               var node = nodes[ways[i].nodes[j]];
               
               var point = new OpenLayers.Geometry.Point(node.lon, node.lat);
               
               // Since OSM is topological, we stash the node ID internally. 
               point.osm_id = parseInt(ways[i].nodes[j]);
               point_list[j] = point;
               
               // We don't display nodes if they're used inside other 
               // elements.
               node.used = true; 
            }
            var geometry = null;
            if (poly) { 
                geometry = new OpenLayers.Geometry.Polygon(
                    new OpenLayers.Geometry.LinearRing(point_list));
            } else {    
                geometry = new OpenLayers.Geometry.LineString(point_list);
            }
            if (this.internalProjection && this.externalProjection) {
                geometry.transform(this.externalProjection, 
                    this.internalProjection);
            }        
            var feat = new OpenLayers.Feature.Vector(geometry,
                ways[i].tags);
            feat.osm_id = parseInt(ways[i].id);
            feat.fid = "way." + feat.osm_id;
            feat_list[i] = feat;
        } 
        for (var node_id in nodes) {
            var node = nodes[node_id];
            if (!node.used || this.checkTags) {
                var tags = null;
                
                if (this.checkTags) {
                    var result = this.getTags(node.node, true);
                    if (node.used && !result[1]) {
                        continue;
                    }
                    tags = result[0];
                } else { 
                    tags = this.getTags(node.node);
                }    
                
                var feat = new OpenLayers.Feature.Vector(
                    new OpenLayers.Geometry.Point(node['lon'], node['lat']),
                    tags);
                if (this.internalProjection && this.externalProjection) {
                    feat.geometry.transform(this.externalProjection, 
                        this.internalProjection);
                }        
                feat.osm_id = parseInt(node_id); 
                feat.fid = "node." + feat.osm_id;
                feat_list.push(feat);
            }   
            // Memory cleanup
            node.node = null;
        }        
        return feat_list;
    }
410762
public static Element svgElement(Document document, String name) {
    return document.createElementNS(SVGConstants.SVG_NAMESPACE_URI, name);
  }
1031441
public static BsonDocument copyOfDocument(final BsonDocument document) {
    final BsonDocument newDocument = new BsonDocument();
    for (final Map.Entry<String, BsonValue> kv : document.entrySet()) {
      newDocument.put(kv.getKey(), kv.getValue());
    }
    return newDocument;
  }