Re: Parsing multiple XML documents as strings. Inbox
| From: | Christian Stocker | Date: | Tue, 07 Dec 2004 05:47:11 +0000 |
| Subject: | Re: Parsing multiple XML documents as strings. Inbox | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203657@lists.php.net to get a copy of this message | ||
On Mon, 6 Dec 2004 23:10:15 +0100, Goformusic Support
<goformusic@gmail.com> wrote:
> Hi,
>
> We worked with Sablotron before but switched over to the libxslt
> library on PHP5 to perform XSL transformations. We used the wrapper
> code found on http://be.php.net/xsl so that our old xslt_
> functions
> continued to work.
>
> Now, with Sablotron we used to parse multiple XML documents as strings
> and one XSL file from disk. With libxslt it doesn't seem possible
> parsing XML documents as strings.
>
> This is the old method which worked fine, using Sablotron:
>
> $args["/list_docu"] = "<content>some xml</content>";
> $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $args,
> $params);
>
> This node could then be access with XSL:
> <xsl:for-each select="document('arg:/list_docu')/content">
>
> When I run this code using libxslt/PHP5 and the wrapper I get the error:
> Warning: I/O warning : failed to load external entity "arg:/list_docu"
>
> This is because the XML documents must be saved on disk I guess.
> Isn't there any way to load the XML documents as strings???
I don't know your wrapper class, but it's perfectly possible to load
XML documents from strings:
see
http://ch.php.net/manual/en/ref.xsl.php
and
http://ch.php.net/manual/en/function.dom-domdocument-loadxml.php
for further details.
chregu
>
> Grtz,
>
> Bart
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid
0x5CE1DECB