From 7a9aeae5625a4b9e62a5a2745160f8e50e0b8a1a Mon Sep 17 00:00:00 2001 From: Jake Jackson Date: Fri, 12 Apr 2024 18:09:12 +1000 Subject: [PATCH] For later --- .../basic-manipulation-filter-and-retrieval/index.php | 2 ++ examples/create-html-document/index.php | 4 +++- examples/create-xml-document/index.php | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/basic-manipulation-filter-and-retrieval/index.php b/examples/basic-manipulation-filter-and-retrieval/index.php index 8ca19ba..84f99cb 100644 --- a/examples/basic-manipulation-filter-and-retrieval/index.php +++ b/examples/basic-manipulation-filter-and-retrieval/index.php @@ -2,6 +2,8 @@ require_once __DIR__ . '/../../vendor/autoload.php'; +//TODO - consider writeHTML() or writeXML() instead of html() / xml() + /* * HTML Example */ diff --git a/examples/create-html-document/index.php b/examples/create-html-document/index.php index aeead71..7ba80c2 100644 --- a/examples/create-html-document/index.php +++ b/examples/create-html-document/index.php @@ -20,10 +20,12 @@ echo 'You can use QueryPath to build complex HTML documents using a simple jQuery-like API:'; +//TODO - consider writeHTML() instead of html() + echo '
<?php 
 
 // Begin with an HTML5 stub document and navigate to the title.
-html5qp(\QueryPath\QueryPath::HTML5_STUB, "title")
+echo html5qp(\QueryPath\QueryPath::HTML5_STUB, "title")
 	// Add text to the title
 	->text("Example of QueryPath.")
 	// Traverse to the root of the document, then locate the body tag
diff --git a/examples/create-xml-document/index.php b/examples/create-xml-document/index.php
index 2407e60..e5c6c6f 100644
--- a/examples/create-xml-document/index.php
+++ b/examples/create-xml-document/index.php
@@ -21,8 +21,14 @@
  *  By default, it will point to the root element ``
  */
 
+//TODO
+// Use QueryPath::withXML() will allow you to omit the XML declaration ""
+// 	\QueryPath\QueryPath::withXML('')
+//		->append('Wiseman')
+//		->writeXML();
+
 try {
-	echo qp('')
+	qp('')
 		// Add a new last name inside of author.
 		->append('Wiseman')
 		// Select all of the children of . In this case,
@@ -46,7 +52,7 @@
 		// turn the QueryPath contents back into a string. Since we are
 		// at the top of the document, the whole document will be converted
 		// to a string.
-		->xml();
+		->writeXML();
 } catch (\QueryPath\Exception $e) {
 	die($e->getMessage());
 }