You are here: Re: Open XML without the XSL « All PHP « IT news, forums, messages
Re: Open XML without the XSL

Posted by Steve on 11/15/07 21:24

"Maurice van 't Loo" <nospam@nospam.nl> wrote in message
news:473cb182$0$15326$2d805a3e@textnews.eweka.nl...
>
> "Jerry Stuckle" <jstucklex@attglobal.net> 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:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <?xml-stylesheet type="text/xsl" href="/layout/item-info.xsl"?>
>>>
>>> <page globalSearch="1" lang="en_us" requestUrl="/item-info.xml">
>>> <itemInfo>
>>> 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 '<pre>' . file_get_contents('http://www.domain.com/file.xml') .
'</pre>'
?>

what do you get?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация