Open XML without the XSL

Open XML without the XSL

am 15.11.2007 11:27:22 von jvb

Hi all,

Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL file
in php?

The file i want to open is:






etc.

But when i open the file, it opens as an html file, but i want the raw
xml...

I tried fopen() but than i get the xhtml in stead of xml...

Thanks in advance,
Maurice van 't Loo
The Netherlands

Re: Open XML without the XSL

am 15.11.2007 14:21:28 von Jerry Stuckle

Maurice van 't Loo wrote:
> Hi all,
>
> Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL
> file in php?
>
> The file i want to open is:
>
>
>
>
>
>
> etc.
>
> But when i open the file, it opens as an html file, but i want the raw
> xml...
>
> I tried fopen() but than i get the xhtml in stead of xml...
>
> Thanks in advance,
> Maurice van 't Loo
> The Netherlands
>
>
>

How are you trying to open it? Code helps.

fopen() on a local file should allow you to read/write the file as it
is, no matter what the type.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Open XML without the XSL

am 15.11.2007 20:35:05 von jvb

"Jerry Stuckle" schreef in bericht
news:2bWdnRsoCrt92qHanZ2dnUVZ_qPinZ2d@comcast.com...
> Maurice van 't Loo wrote:
>> Hi all,
>>
>> Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL
>> file in php?
>>
>> The file i want to open is:
>>
>>
>>
>>
>>
>>
>> etc.
>>
>> But when i open the file, it opens as an html file, but i want the raw
>> xml...
>>
>> I tried fopen() but than i get the xhtml in stead of xml...
>
> How are you trying to open it? Code helps.
>
> fopen() on a local file should allow you to read/write the file as it is,
> no matter what the type.


I used for instance:
$file_in = fopen ("http://www.domain.com/file.xml", "r");

fopen() opens the file WITH parsing the xsl, so i get xhtml in stead of xml.
If i open the url in (Vista) Notepad, i see the xml, not the xhtml.

Thanks,
Maurice

Re: Open XML without the XSL

am 15.11.2007 22:24:48 von Steve

"Maurice van 't Loo" wrote in message
news:473cb182$0$15326$2d805a3e@textnews.eweka.nl...
>
> "Jerry Stuckle" schreef in bericht
> news:2bWdnRsoCrt92qHanZ2dnUVZ_qPinZ2d@comcast.com...
>> Maurice van 't Loo wrote:
>>> Hi all,
>>>
>>> Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL
>>> file in php?
>>>
>>> The file i want to open is:
>>>
>>>
>>>
>>>
>>>
>>>
>>> etc.
>>>
>>> But when i open the file, it opens as an html file, but i want the raw
>>> xml...
>>>
>>> I tried fopen() but than i get the xhtml in stead of xml...
>>
>> How are you trying to open it? Code helps.
>>
>> fopen() on a local file should allow you to read/write the file as it is,
>> no matter what the type.
>
>
> I used for instance:
> $file_in = fopen ("http://www.domain.com/file.xml", "r");
>
> fopen() opens the file WITH parsing the xsl, so i get xhtml in stead of
> xml.
> If i open the url in (Vista) Notepad, i see the xml, not the xhtml.

that i know of, fopen knows nothing about xml or xsl...nor should it even
care. try this as your entire script:

echo '

' . file_get_contents('http://www.domain.com/file.xml') . 
'
'
?>

what do you get?

Re: Open XML without the XSL

am 17.11.2007 09:02:57 von kiretose

On Thu, 15 Nov 2007 11:27:22 +0100, Maurice van 't Loo wrote:

> Hi all,
>
> Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL
> file in php?
>
> The file i want to open is:
>
> > href="/layout/item-info.xsl"?>
>
>
>
> etc.
>
> But when i open the file, it opens as an html file, but i want the raw
> xml...
>
> I tried fopen() but than i get the xhtml in stead of xml...
>
> Thanks in advance,
> Maurice van 't Loo
> The Netherlands

Using curl to pull down the file will solve the issue of it parsing out
the style sheet. From the curl output, drop it into simpleXML or whatever
parsing engine youre using and youre all set.

be warned on loops, in my experiences lately simplexml tends to leak a
fair amount of memory.

Re: Open XML without the XSL

am 17.11.2007 09:07:36 von kiretose

On Sat, 17 Nov 2007 08:02:57 +0000, kiretose wrote:

> On Thu, 15 Nov 2007 11:27:22 +0100, Maurice van 't Loo wrote:
>
>> Hi all,
>>
>> Is there a (simpel??) way to open an XML file WITHOUT parsing the XSL
>> file in php?
>>
>> The file i want to open is:
>>
>> >> href="/layout/item-info.xsl"?>
>>
>>
>>
>> etc.
>>
>> But when i open the file, it opens as an html file, but i want the raw
>> xml...
>>
>> I tried fopen() but than i get the xhtml in stead of xml...
>>
>> Thanks in advance,
>> Maurice van 't Loo
>> The Netherlands
>
> Using curl to pull down the file will solve the issue of it parsing out
> the style sheet. From the curl output, drop it into simpleXML or
> whatever parsing engine youre using and youre all set.
>
> be warned on loops, in my experiences lately simplexml tends to leak a
> fair amount of memory.

i forgot to add we're 90% done setting up a cooperative database to mine
the site youre scripting for there, at least arena + char pages...

drop me a line to the email listed here and Ill get you information later
this week, the goal is a central database to drop spider results off at,
and in the end get access to them all.