libary.xml
<project name="buildlibrary" default="hello">
<target name="hello" hidden="yes">
<echo message="Hello World!"/>
</target>
</project>
@echo off & setlocal enabledelayedexpansion | |
IF "%~1"=="" GOTO Help | |
IF "%~1"=="list" GOTO ListVersion | |
IF "%~1"=="bat" GOTO CreateBatchFiles | |
:LINK_VERSION | |
set PHP_VERSION=%1 | |
set PHP_BASE_PATH=%~dp0 | |
set "PHP_BINARY=%~dp0PHP_%PHP_VERSION%\php" |
<?php | |
// define the namespace URI as a constant | |
// this is often an URL but it does not have to be one | |
// in existing XMLs look for the "xmlns/xmlns:*" attributes | |
const XMLNS_EXAMPLE = 'urn:example-namespace'; | |
// load a really basic XML with the example namespace | |
$document = new DOMDocument(); | |
$document->loadXML('<f:foo xmlns:f="urn:example-namespace">content</f:foo>'); |
libary.xml
<project name="buildlibrary" default="hello">
<target name="hello" hidden="yes">
<echo message="Hello World!"/>
</target>
</project>
<?xml version="1.0"?> | |
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="150" height="100"> | |
<defs> | |
<filter id="b"> | |
<feGaussianBlur stdDeviation="12"/> | |
</filter> | |
<linearGradient id='spinner'> | |
<stop stop-color='rgba(255, 255, 255, 0)'/> | |
<stop offset='0.2' stop-color='rgba(255, 255, 255, 0)'/> | |
<stop offset='0.5' stop-color='#fff'/> |
I hereby claim:
To claim this, I am signing this object:
<?php | |
$xml = file_get_contents('php://stdin'); | |
class MyXpath extends DOMXpath { | |
private static $_context = null; | |
public function __construct($document) { | |
parent::__construct($document); |
<?php | |
class MySimpleXMLElement extends SimpleXMLElement { | |
public function addChild($name, $value = null, $namespace = null) { | |
$result = parent::addChild($name, null, $namespace); | |
if (isset($value)) { | |
$node = dom_import_simplexml($result); | |
$node->appendChild($node->ownerDocument->createTextNode($value)); | |
} |
<?php | |
$xml = <<<'XML' | |
<root attribute="42"></root> | |
XML; | |
$dom = new DOMDocument(); | |
$dom->preserveWhiteSpace = FALSE; | |
$dom->loadXml($xml); |
<?php | |
require_once(__DIR__.'/vendor/autoload.php'); | |
function test_fd() { | |
$html = file_get_contents(__DIR__.'/data.html'); | |
$html = '<?xml encoding="utf-8"?>'.$html; | |
$dom = FluentDOM::load($html, 'text/html'); | |
$r = array(); |
var XMLCreatorFactory = function(dom, resolver) { | |
if (dom === true) { | |
dom = document.implementation.createDocument('', '', null); | |
} else if (!(dom instanceof Document)) { | |
dom = document; | |
} | |
var lookupNamespaceURI; | |
if (resolver instanceof Function && !resolver.lookupNamespaceURI instanceof Function) { | |
lookupNamespaceURI = resolver; |