You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aliased in the filter as `xml-extract`, this will ensure the given string value is valid XML then extract and return the element found at the given xpath.
679
+
680
+
The following ensures the given string is valid xml and returns the title element of the first book.
681
+
```php
682
+
$value = <<<XML
683
+
<?xmlversion="1.0"?>
684
+
<books>
685
+
<bookid="bk101">
686
+
<author>Gambardella, Matthew</author>
687
+
<title>XML Developers Guide</title>
688
+
<genre>Computer</genre>
689
+
<price>44.95</price>
690
+
<publish_date>2000-10-01</publish_date>
691
+
<description>An in-depth look at creating applications with XML.</description>
692
+
</book>
693
+
<bookid="bk102">
694
+
<author>Ralls, Kim</author>
695
+
<title>Midnight Rain</title>
696
+
<genre>Fantasy</genre>
697
+
<price>5.95</price>
698
+
<publish_date>2000-12-16</publish_date>
699
+
<description>A former architect battles corporate zombies</description>
Aliased in the filter as `xml-validate`, this will ensure the given string value is valid XML and also confirms to the given XSD file. The original value is returned.
710
+
711
+
The following ensures the given string is valid xml and matches books.xsd.
712
+
```php
713
+
$value = <<<XML
714
+
<?xmlversion="1.0"?>
715
+
<books>
716
+
<bookid="bk101">
717
+
<author>Gambardella, Matthew</author>
718
+
<title>XML Developers Guide</title>
719
+
<genre>Computer</genre>
720
+
<price>44.95</price>
721
+
<publish_date>2000-10-01</publish_date>
722
+
<description>An in-depth look at creating applications with XML.</description>
723
+
</book>
724
+
<bookid="bk102">
725
+
<author>Ralls, Kim</author>
726
+
<title>Midnight Rain</title>
727
+
<genre>Fantasy</genre>
728
+
<price>5.95</price>
729
+
<publish_date>2000-12-16</publish_date>
730
+
<description>A former architect battles corporate zombies</description>
0 commit comments