Re: [PHP] PHP XML

2004-10-27 Thread Dan Joseph
 how is the xml being sent to you from the other place on the internet? is
 it being posted in a form, etc.?

It won't be thru a form.  I guess it'll be a direct send, he'll format
something like...

request
   nameJack/name
   account239048098324/account
/request

... in a string and send it over.

What methods are best suited for something like that?  Would it be
best Side One to open a socket up to Side Two and send it thru that
way?  I'm open to suggestions...

-Dan Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP XML

2004-10-27 Thread Bill McCuistion
Dan Joseph wrote:

 how is the xml being sent to you from the other place on the internet? is
 it being posted in a form, etc.?
 
 It won't be thru a form.  I guess it'll be a direct send, he'll format
 something like...
 
 request
nameJack/name
account239048098324/account
 /request
 
 ... in a string and send it over.
 
 What methods are best suited for something like that?  Would it be
 best Side One to open a socket up to Side Two and send it thru that
 way?  I'm open to suggestions...
 
 -Dan Joseph

Look at the SOAP functions.  There's a SOAP client  SOAP server.  The
applications use SOAP calls to transfer their XML messages over the
Intenet, typically http/https, but could also use smtp for transport.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP XML

2004-10-27 Thread Dan Joseph
 Look at the SOAP functions.  There's a SOAP client  SOAP server.  The
 applications use SOAP calls to transfer their XML messages over the
 Intenet, typically http/https, but could also use smtp for transport.

oh... good idea, I didn't even think of SOAP.  I'll check with our
other developer tomorrow to see if his Side One can handle that.. 
thanks for the tip.

-Dan Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP-XML Parse Problem

2004-05-11 Thread Chris Hayes
At 13:44 11-5-04, you wrote:
I wrote a script to parse an XML doc in straightforward PHP, but then decide
to write it as objects
but now I have a problem, that I hope someone with a  little bit more
experience can look at:
Im at my wits end and would appreciate any help, im getting no errors as
such, but it is not parsing the
information.
You can read the script easier here:  http://www.pastebin.com/64934
Have you checked how far the script gets? Could you point the line that you 
think is the suspect?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php-xml

2003-11-17 Thread Becoming Digital
Please post some of your code.  It is incredibly difficult to help you without it.

Edward Dudlik
Those who say it cannot be done
should not interrupt the person doing it.

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU



- Original Message - 
From: pnp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, 17 November, 2003 05:42
Subject: [PHP] php-xml


Hi, I'm developing a web site for a greek company and I want to show some
greek texts from an xml file to an html page. The pages encoding is utf-8.
So is the xml file and the xmlparses params. But the output is a bunch of
???...

What am I doing wrong? Is there any way to do this?

Thanks in advance,
Peter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php-xml

2003-11-17 Thread Curt Zirzow
* Thus wrote pnp ([EMAIL PROTECTED]):
 Hi, I'm developing a web site for a greek company and I want to show some
 greek texts from an xml file to an html page. The pages encoding is utf-8.
 So is the xml file and the xmlparses params. But the output is a bunch of
 ???...

You need to set the charset for the document to a greek charset so
it knows how the characters are encoded. You also have to make sure
that that charset is on the computer viewing the page.

ie:
  header('Content-Type: text/html; charset=ISO-8895-7');

Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php-xml

2003-11-17 Thread pnp
I think i found it...

thank you for trying to help.

Peter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP XML Reference

2003-03-13 Thread Javagal S Reddy
Hi Tim,

I have used the big ass Professional PHP 4 XML book from Wrox 
for the last 6 months, and i have picked up immense knowledge from 
that resource. Infact i have gone up in my career to being the 
lead web developer in my team...and i must atribute it to this 
book.

You can find more information here:

http://www.amazon.com/exec/obidos/ASIN/1861007213/qid%3D1047628025/sr%3D11-1/ref%3Dsr%5F11%5F1/002-9385423-3309610

Good luck,
-Javagal
On Fri, 14 Mar 2003 Tim Funk wrote :
Hi,

I am new to PHP, however i have a good handle on C programming 
and therefore hope to apply those conceps to PHP programming 
quickly. I am looking for a print reference that can help me to 
construct a web-based front-end for an application using XML. Any 
help in this regard will bemuch appreciated.

Thanks,
Tim


-
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP XML

2002-10-16 Thread Chris Boget

   Do you realize more benifit for the back end
   processes when using XML that makes any additional time it takes
   to display a page to the user worth it?
 Just ask the user if they really want to wait longer for something they 
 can't even see, just so you can use the latest buzzword in describing 
 your site.
 I'm sure they'll say NO!

Hell, I would answer No, too.

But I'm not considering XML just because it's the latest buzzword.  I've
been part of the industry too long to be lulled by such things.  The reason
I'm considering XML is to allow things like themes and also to standardize
and optimize messages that would be sent to various services that I could
create and set up with a redesign.  It would also allow me to create external
companion software that could communicate with the website and allow some
of the daily work of the end user to take place offline.

Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread Maxim Maletsky


Chris Boget [EMAIL PROTECTED] wrote... :

 Let me preface this by saying that I know the benefits of using
 XML with regards to portability and extensibility.

Yes, there are many benefits.

 Here is the issue I face.  I have all of my data stored in a MySQL
 database.  I'm considering reworking my website so that it uses
 XML (after being converted from resultant records in my DB) to 
 transmit  XSLT to transform and display the data to my end user.

It is indeed a very elegant way of creating dynamic sites.

 There are a few benifits I can see in sending XML messages as
 part of the back end processing.  However, that seems to be out-
 weighed by the amount of processing that's going to need to take
 place in actually serving the data to the user.  

True, it is more that just embedding PHP variables into an HTML
templates.

 First I have to query and pull the records from the database.

Ideally, you could also store some text XML-formatted already in DB.
Always, if that makes sense. I do it for the article, long texts to be
formatted.

 Then,
 I need to send those records to a function (or functions) to convert
 it to XML.

Try modulate it with Classes. (an extra overhead, I know, but adds you
the portability.. which, I believe is important for you)

 Then, I need to take that XML data and have PHP use
 an XSL stylesheet to transform it to HTML before it, finally, gets 
 sent on to the browser.  So that's basically 2 conversions that take
 place on the back end.

Before actually send it to the browser, save (cache) the HTML file to
your local system, so them later you can reuse it directly should no
data change in between.

 How much experience have any of you had with doing that?  

Many do that. You can create some real dynamic sites, skins etc..

 Does 
 it take significantly longer to serve the pages; is there a noticible
 performance hit? 

If well designed, the overhead will only be some few milliseconds. This
is not much, considering that now the machines get faster and faster.

 Do you realize more benifit for the back end 
 processes when using XML that makes any additional time it takes 
 to display a page to the user worth it?

Yes, having a more dynamic site means less efforts on additional
eventual features to implement. Thus, not only the extra 100
milliseconds for user to wait, but rather the cheaper maintaining costs
and higher quality. It often means cheaper services in some businesses.

 I'd love to hear about people's experience with this kind of thing so I
 can better make a decision wrt whether or not I should even go down
 this route.

I would go for it (in fact I working myself on similar system these days).
One thing I'd recommend you is to invest some relatively sufficient
time on studying well the application design so you can make it as
dynamic as possible. For speed purpose, you should organize yourself a
caching system. An idea would be tracking down the changes on the DB and
saving all rendered HTML files to then compare on the request and reuse
unchanged sections of the website. It, of course, depends 85% on your
application data, logic and specifications. So, invest enough time,
prepare your database for cache and add XML/XSLT/PHP trio.

Good luck!

-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread Geoff Hankerson

A few ideas:
1. I have been setting up a system to do almost exactly what you are 
doing (database -- xml -- xslt--html via a custom class) and have not 
noticed any significant performance hit, but this is not in production 
so your mileage may vary, but my gut feeling is the performance hit is 
very small (real scientific - not).

2. Does all this data from your database have to be converted on the 
fly? In other words does it have to be completely dynamic? If some of 
the content is updated fairly infrequently then you could have a 
cron-job type process  convert from database to xml files at a given 
interval (hourly, weekly, montly etc..). Or even think about whether 
your data  needs to live in a database. Can it just live in an xml file?

3. Modern browsers can convert using xslt themselves  so you could check 
the user agent and have the browser transform the xml if it is capable 
(IE5-6, Netscape 6-7, mozilla etc...)

I am going to do all the transformation on the server and  live with the 
slight performance hit.
I think the benefits are worth it. Making and maintaining a site become 
so easy once you have this set up. The code on each page is compact and 
almost exactly the same, the only variance is the sql statement and the 
name of the xsl file.

Go ahead and email me off list if you want to discuss this off list

Chris Boget wrote:

Let me preface this by saying that I know the benefits of using
XML with regards to portability and extensibility.
Here is the issue I face.  I have all of my data stored in a MySQL
database.  I'm considering reworking my website so that it uses
XML (after being converted from resultant records in my DB) to 
transmit  XSLT to transform and display the data to my end user.
There are a few benifits I can see in sending XML messages as
part of the back end processing.  However, that seems to be out-
weighed by the amount of processing that's going to need to take
place in actually serving the data to the user.  
First I have to query and pull the records from the database.  Then,
I need to send those records to a function (or functions) to convert
it to XML.  Then, I need to take that XML data and have PHP use
an XSL stylesheet to transform it to HTML before it, finally, gets 
sent on to the browser.  So that's basically 2 conversions that take
place on the back end.
How much experience have any of you had with doing that?  Does 
it take significantly longer to serve the pages; is there a noticible
performance hit?  Do you realize more benifit for the back end 
processes when using XML that makes any additional time it takes 
to display a page to the user worth it?
I'd love to hear about people's experience with this kind of thing so I
can better make a decision wrt whether or not I should even go down
this route.

thnx,
Chris

  





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread .: B i g D o g :.

Chris,

Here are some ideas you might want to review these options:

1. Try storing the data in the database as xml files them selves.  You
then do not have to create the xml file.  This will no doubt increase
your database size.

2. Store your xml templates in the database for faster retrieval.

3. Have the xml file reference the xslt file for the translation to
occur on the client end...they get the HTML and all u really worry about
is creating the xml file and having the xslt file.

4. Do the translation of Database - XML - XSLT - HTML all in PHP and
save the HTML output for caching. Then u can save a link to that file in
your database.  This will allow you to have a very good caching system. 
When a request for a page comes in u can verify if the cached link in
the database is too old or not.  Then you can either get the link to the
cached file or get the data to create the XML file.

But, I have a feeling that this will still be extremely sufficient for
your speed requirements...



On Tue, 2002-10-15 at 08:25, Chris Boget wrote:
 Let me preface this by saying that I know the benefits of using
 XML with regards to portability and extensibility.
 Here is the issue I face.  I have all of my data stored in a MySQL
 database.  I'm considering reworking my website so that it uses
 XML (after being converted from resultant records in my DB) to 
 transmit  XSLT to transform and display the data to my end user.
 There are a few benifits I can see in sending XML messages as
 part of the back end processing.  However, that seems to be out-
 weighed by the amount of processing that's going to need to take
 place in actually serving the data to the user.  
 First I have to query and pull the records from the database.  Then,
 I need to send those records to a function (or functions) to convert
 it to XML.  Then, I need to take that XML data and have PHP use
 an XSL stylesheet to transform it to HTML before it, finally, gets 
 sent on to the browser.  So that's basically 2 conversions that take
 place on the back end.
 How much experience have any of you had with doing that?  Does 
 it take significantly longer to serve the pages; is there a noticible
 performance hit?  Do you realize more benifit for the back end 
 processes when using XML that makes any additional time it takes 
 to display a page to the user worth it?
 I'd love to hear about people's experience with this kind of thing so I
 can better make a decision wrt whether or not I should even go down
 this route.
 
 thnx,
 Chris
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread Chris Boget

 Here are some ideas you might want to review these options:

Other people have suggested variations of the below so I'll just respond
here to cut down on the bandwidth.
 
 1. Try storing the data in the database as xml files them selves.  You
 then do not have to create the xml file.  This will no doubt increase
 your database size.

This, unfortunately, is not a possiblity because the databases get updated
too frequently.  Plus, I have 2 tables that have in excess of 80k records
which also gets updated frequently.  File I/O for updating a flat file DB would
be atrocious.

 2. Store your xml templates in the database for faster retrieval.

Please elaborate on this suggestion?

 3. Have the xml file reference the xslt file for the translation to
 occur on the client end...they get the HTML and all u really worry about
 is creating the xml file and having the xslt file.

As far as I know, there are several issues with the various browsers processing
and executing the XSL.  There isn't full compliance, particularly with the actual
commands (ie, xsl:copy, xsl:copy-of, etc) and/or if you want to manipulate the
tree/DOM.  
Is this untrue?

 4. Do the translation of Database - XML - XSLT - HTML all in PHP and
 save the HTML output for caching. 

For the most part, this isn't feasible due to number 1 above.  And for those files
that I can cache, the data set being retrieved is so small that any performance
hit (if any) would certainly be insignificant.  So there wouldn't be much point in
caching those.
Even so, this does give me a few ideas and could possibly be the solution to a
very different problem I need to address.

Thank you all for your ideas and suggestions thus far.  Please keep them coming
if you haven't chimed in or if you think of anything else.  I'm sure this information 
is 
helping other people as well!

Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread Rick Widmer

At 09:25 AM 10/15/02 -0500, Chris Boget wrote:
Let me preface this by saying that I know the benefits of using
XML

It seems to me most of the benefits of XML actually go to the hardware
and network suppliers.  They get to sell you bigger storage for the
bloated data, faster processors for the mindless transformations and
bigger pipes to transfer all the extra markup in an XML file.

XML has its place in simplifying data exchange (if both parties can
find or agree on a common schema) and things like the PHP documentation
where there is a real need to present one source document several
different ways.

Why waste space in a database with XML.  The database already is one
of the most efficient ways to store the data.  So no XML for storage.

Unless you have more than one way you need to present the data on your
web pages you are wasting both your time, and processor time trying to
add XML into the mix.

Rick



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread .: B i g D o g :.

On Tue, 2002-10-15 at 15:03, Chris Boget wrote:
  Here are some ideas you might want to review these options:
 
 Other people have suggested variations of the below so I'll just respond
 here to cut down on the bandwidth.
  
  1. Try storing the data in the database as xml files them selves.  You
  then do not have to create the xml file.  This will no doubt increase
  your database size.
 
 This, unfortunately, is not a possiblity because the databases get updated
 too frequently.  Plus, I have 2 tables that have in excess of 80k records
 which also gets updated frequently.  File I/O for updating a flat file DB would
 be atrocious.
  2. Store your xml templates in the database for faster retrieval.
 
 Please elaborate on this suggestion?

sample xml page:
?xml version=1.0?
page
title/title
/page

So, then in theory, this is a xml template (contains no data) that can
be stored in the database.


  3. Have the xml file reference the xslt file for the translation to
  occur on the client end...they get the HTML and all u really worry about
  is creating the xml file and having the xslt file.
 
 As far as I know, there are several issues with the various browsers processing
 and executing the XSL.  There isn't full compliance, particularly with the actual
 commands (ie, xsl:copy, xsl:copy-of, etc) and/or if you want to manipulate the
 tree/DOM.  
 Is this untrue?
 
  4. Do the translation of Database - XML - XSLT - HTML all in PHP and
  save the HTML output for caching. 
 
 For the most part, this isn't feasible due to number 1 above.  And for those files
 that I can cache, the data set being retrieved is so small that any performance
 hit (if any) would certainly be insignificant.  So there wouldn't be much point in
 caching those.
 Even so, this does give me a few ideas and could possibly be the solution to a
 very different problem I need to address.

Actually you do not have to store the data and xml (together) in the
database.

Here are the steps to perform:
1. Query database getting desired data.
2. get the xml file into PHP XML parser (either from a database or
file.)
3. Parse xml file adding data to the file. Result is a new xml file.
(XML template + data)
4. Optional (if xslt is compiled into PHP). You can do the translation
of your XML file and XSLT file in PHP which could result in a html file
or direct output to the browser.
5. Send the XML file to the browser with the XSLT information
information in the XML file (not so much XSL). And let the browser
handle the transformation to HTML for ya.

Also note that the XSLT file is a great place to put all your themes.  U
can have one XSLT file for each theme that handles your site.

The options are endless...


That is relatively all that needs to be done.

 Thank you all for your ideas and suggestions thus far.  Please keep them coming
 if you haven't chimed in or if you think of anything else.  I'm sure this 
information is 
 helping other people as well!
 
 Chris
 

-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP XML

2002-10-15 Thread Rick Widmer

At 09:25 AM 10/15/02 -0500, Chris Boget wrote:

  Do you realize more benifit for the back end
  processes when using XML that makes any additional time it takes
  to display a page to the user worth it?


Just ask the user if they really want to wait longer for something they 
can't even see, just
so you can use the latest buzzword in describing your site.

I'm sure they'll say NO!

It is never worth anything that makes it take longer to display a page to 
the user.

Sorry I missed this in the last message... it is important.

Rick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP, XML and HTML-Tags

2002-08-13 Thread Analysis Solutions

On Tue, Aug 13, 2002 at 03:22:03PM +0200, Bernard wrote:
 
 I am using successfully the PHP XML-parser. But I have one problem.
 I like to include html tags into the texts and I don't want them to be 
 interpreted by the parser.

Have you tried putting the XML in CDATA sections?  That's really where 
such things should be.

http://www.w3.org/TR/2000/REC-xml-20001006#sec-cdata-sect

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] PHP, XML

2002-01-07 Thread Boget, Chris

 Does anyone know of a mailing list for PHP and XML or can I 
 just pose them here??

PHP-XML.  The list address is:

[EMAIL PROTECTED]

Chris



Re: [PHP] PHP XML with Dynamic Content

2002-01-05 Thread Emile Bosch

Writing it on the fly would be kinda redundant.. I think.. :(
from mysql data to xml to data.. .. would slow things down a bit i
think.. :(

Brian Clark [EMAIL PROTECTED] wrote in message
20020105030550.GD17616@ganymede">news:20020105030550.GD17616@ganymede...
 * Emile Bosch ([EMAIL PROTECTED]) [Jan 03. 2002 15:38]:

  Hi a lot of todays proffesional content management systems use XML, now
  i was wondering how it's possible to mix XML with Dynamic Content, or
  content which is change sensitive, IE A shop, or an auction,
  let's say you have a shop with 1000 products, how am i gonna mix this in
  the XML?

  Does anyone know how this is solved, because i don't think that you are
  gonna write hundreds of XML files for each article, can someone please
help
  me out here?

 I understand the first paragraph up to how am i gonna mix this in the
 XML?

 Why couldn't you store information in a database and write the XML files
 on the fly when you need XML? Or update the XML file when something
 changes? Or, why use XML at all? Do you _really_ need it? *confused*

 --
 Brian Clark | Avoiding the general public since 1805!
 Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
 Sex is the most fun you can have without laughing.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML with Dynamic Content

2002-01-04 Thread Brian Clark

* Emile Bosch ([EMAIL PROTECTED]) [Jan 03. 2002 15:38]:

 Hi a lot of todays proffesional content management systems use XML, now
 i was wondering how it's possible to mix XML with Dynamic Content, or
 content which is change sensitive, IE A shop, or an auction,
 let's say you have a shop with 1000 products, how am i gonna mix this in
 the XML?

 Does anyone know how this is solved, because i don't think that you are
 gonna write hundreds of XML files for each article, can someone please help
 me out here?

I understand the first paragraph up to how am i gonna mix this in the
XML?

Why couldn't you store information in a database and write the XML files
on the fly when you need XML? Or update the XML file when something 
changes? Or, why use XML at all? Do you _really_ need it? *confused*

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Sex is the most fun you can have without laughing.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML

2001-12-19 Thread Bas van Rooijen


For XML use parser: http://www.php.net/manual/en/ref.xml.php

PHP in .xsl file is possible, edit your httpd.conf

find this line:
AddType application/x-httpd-php .phtml .php .php3

and add extensions that should be parsed by PHP, like so:

AddType application/x-httpd-php .phtml .php .php3 .xsl

be carefull, anything between ? and ? will be executed by
default. if this may conflict with the nature of the output (like .xml files)
you can edit your php.ini to force long open tags ?php

find this line:
short_open_tag = On

change On to Off


bvr.

On Thu, 20 Dec 2001 01:34:58 -, Martin Hughes wrote:

Heya,

Is it possible to integrate XML with PHP - ie get data out of an XML file
and format it in html using php? Or alternatively, use php within an XSL
file...?

Cheers

Mart




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML

2001-12-19 Thread Martin Hughes

Thanks! Much appreciated.

M

Bas Van Rooijen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

 For XML use parser: http://www.php.net/manual/en/ref.xml.php

 PHP in .xsl file is possible, edit your httpd.conf

 find this line:
 AddType application/x-httpd-php .phtml .php .php3

 and add extensions that should be parsed by PHP, like so:

 AddType application/x-httpd-php .phtml .php .php3 .xsl

 be carefull, anything between ? and ? will be executed by
 default. if this may conflict with the nature of the output (like .xml
files)
 you can edit your php.ini to force long open tags ?php

 find this line:
 short_open_tag = On

 change On to Off


 bvr.

 On Thu, 20 Dec 2001 01:34:58 -, Martin Hughes wrote:

 Heya,
 
 Is it possible to integrate XML with PHP - ie get data out of an XML file
 and format it in html using php? Or alternatively, use php within an XSL
 file...?
 
 Cheers
 
 Mart






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML (2)

2001-12-19 Thread Bas van Rooijen

and restart ofcourse ;)

bvr.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML

2001-12-07 Thread Mike Eheler

You could also do it like:

?= '?xml version=1.0 encoding=UTF-8?' ?

Mike

Steve Haemelinck wrote:

Hi Guys

I am developing with PHP and XML. Now I experience some problem with the
processing instructions of xml (?xml version=1.0 encoding=UTF-8?)
which causes PHP to return a parsing error.
This is logical because ? is also the short-tag processing instruction for
PHP.  Does anybody got an idea how to solve this problem without disabling
the short-tags in the php.ini fiel ?

Thx





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML

2001-12-07 Thread Erik Price

I thought that short tags were illegal in XHTML and XML.
But I could be wrong.


On Friday, December 7, 2001, at 01:53  PM, Steve Haemelinck wrote:

 Hi Guys

 I am developing with PHP and XML. Now I experience some problem with the
 processing instructions of xml (?xml version=1.0 encoding=UTF-8?)
 which causes PHP to return a parsing error.
 This is logical because ? is also the short-tag processing instruction 
 for
 PHP.  Does anybody got an idea how to solve this problem without 
 disabling
 the short-tags in the php.ini fiel ?

 Thx



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML Parsing

2001-05-23 Thread Peter Dudley

 Interesting..  So to be consistent with proper XML formatting,
 should the server hosting the XML file convert the  into
 amp; ?

It depends on the situation, I believe.  The server that sends you XML
should indeed provide you well-formed XML, which it's not doing.  Probably
what should happen is that the server sending the XML should urlencode URLs
in the cdata elements, and then after you parse the XML file you should
urldecode the URLs.  I would be surprised if this hasn't been done as some
standard part of XML parsing and I've just missed it in my limited use of
XML parsers.

 I certainly feel like I'm missing something...  Although I'm a bit at
 odds as to how to troubleshoot this new file.
 I no longer get the errors, but I'm not getting the results I'm looking
for either.


I'm not sure what results you're looking for exactly, but if you put in a
bunch of echo statements at various points throughout your parsing routines,
you will see that none of the if x = y conditions are matching.  Here's
what I'd recommend:

1.  put in a bunch of echo statements to print out your variables at
different points in your parsing, just to make sure it's doing what you
expect it to.  Do a full audit of your characterData routine through this
method, and I think it will show you where the errors are.  (I did not see
the exact error right away so I gave up since I do have a day job.  :-)

2.  keep your first eregi_replace statement, then when you're printing out
the links, re-convert it with a reverse eregi_replace to turn the amp; back
into a simple .  This will send it to the HTML browser in the format you
want, I hope.

I hope this is of some help.

Pete.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML Parsing

2001-05-22 Thread Mike Gifford

Hello Fabian,

This was very helpful.  Thanks for letting me know about this little glitch.

It almost resolves the problem that I was having.  Now I no longer get xml 
errors.  However, I'm not able to output the XML either.

Any suggestions would be appreciated.  The updated code is available here:
http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php

And I've included the full script in the email (at the very bottom of this message).

Thanks.


Mike

Fabian Raygosa wrote:

 for xml you have to escape certain characters in the file, one is the
 ampersand ...
 - Original Message -
 From: Mike Gifford [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, May 18, 2001 12:24 PM
 Subject: [PHP] PHP  XML Parsing
 
 
 
 Hello,
 
 In looking for a good script to parse XML files I stumbled across the
 
 following
 
 tutorial (which looks very good):
 http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html
 
 I have set this script up here:
 http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php
 
 and I keep getting the following error (even after making a number of
 
 changes):
 
 XML error: not well-formed at line 16
 
 And I'm not sure how to troubleshoot this problem.
 
 I'm assuming that it is referring to line 16 on the XML file, in this
 
 case:
 
 http://cupe.ca/xml/cupenews.rdf
 
 My parsing definitions are as follows
$itemTitleKey = ^rdf^item^title;
$itemLinkKey = ^rdf^item^link;
$itemDescKey = ^rdf^item^description;
 
 Any help would be appreciated.
 
 Mike
 --
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://halifaxinitiative.org
 A good life is one inspired by love and guided by knowledge - B. Russell
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

?php

class xitem {
   var $xTitle;
   var $xLink;
   var $xDescription;
  // function xitem() {
  // }
}

// general vars
$sTitle = Airline Division Newsfeeds;
$sLink = http://airdiv.cupe.ca/portal/;;
$sDescription = A Portal for the Airline Division of CUPE;
$arItems = array();
$itemCount = 0;

// * Start User-Defined Vars 
// rss url goes here
$uFile =http://cupe.ca/xml/cupenews.rdf;;
// descriptions (true or false) goes here
$bDesc = ; // If it exists this should be 'true'
// font goes here
$uFont = Verdana, Arial, Helvetica, sans-serif;
$uFontSize = 2;
// * End User-Defined Vars **

function startElement($parser, $name, $attrs) {
   global $curTag;   $curTag .= ^$name;
}

function endElement($parser, $name) {
   global $curTag;   $caret_pos = strrpos($curTag,'^');
   $curTag = substr($curTag,0,$caret_pos);
}

function characterData($parser, $data) {
global $curTag; // get the Channel information first
   global $sTitle, $sLink, $sDescription;
//  $titleKey = ^RSS^CHANNEL^TITLE;
//  $linkKey = ^RSS^CHANNEL^LINK;
//  $descKey = ^RSS^CHANNEL^DESCRIPTION;
   $titlekey = ^rdf:RDF^channel^title;
   $linkkey = ^rdf:RDF^channel^link;
   $desckey = ^rdf:RDF^channel^description;
   if ($curTag == $titleKey) {
 $sTitle = $data;
 echo  $sTitle;
   }
   elseif ($curTag == $linkKey) {
 $sLink = $data;
  echo  $sLink;
   }
   elseif ($curTag == $descKey) {
 $sDescription = $data;
   }   // now get the items
   global $arItems, $itemCount;
//  $itemTitleKey = ^RSS^CHANNEL^ITEM^TITLE;
//  $itemLinkKey = ^RSS^CHANNEL^ITEM^LINK;
//  $itemDescKey = ^RSS^CHANNEL^ITEM^DESCRIPTION;
   $itemtitlekey = ^rdf:RDF^item^title;
   $itemlinkkey = ^rdf:RDF^item^link;
   $itemdesckey = ^rdf:RDF^item^description;
if ($curTag == $itemTitleKey) {
 // make new xitem
 $arItems[$itemCount] = new xitem(); // set new item object's 
properties
 $arItems[$itemCount]-xTitle = $data;
 echo $data;
   }
   elseif ($curTag == $itemLinkKey) {
 $arItems[$itemCount]-xLink = $data;
 echo $data;
   }
   elseif ($curTag == $itemDescKey) {
 $arItems[$itemCount]-xDescription = $data;
 // increment item counter
 $itemCount++;
 echo $data;
   }

} // main loop

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
if (!($fp = fopen($uFile,r))) {
   die (could not open RSS for input);
}
while ($data = fread($fp, 4096)) {
$data=eregi_replace( , amp;,$data);
echo $data;
   if (!xml_parse($xml_parser, $data, feof($fp))) {
 die(sprintf(XML error: %s at line %d, 
xml_error_string(xml_get_error_code($xml_parser)), 
xml_get_current_line_number($xml_parser)));
   }
}
xml_parser_free($xml_parser); // write out the items
?
html
head
title?php echo ($sTitle); ?/title
meta name = description content = ?php echo ($sDescription); ?
/head
body bgcolor = #FF
font face = ?php 

Re: [PHP] PHP XML Parsing

2001-05-22 Thread Mike Gifford

Hello Peter,

Peter Dudley wrote:

 The problem is in your link URL, where you pass CGI parameters.  When XML
 sees the  character, it assumes it's a special character thing such as
 amp; or quot;, so it's expecting a semicolon.

replacing it with amp; fixed the XML error.  Thanks!
 
 linkhttp://cupe.ca/news/cupenews/showitem.asp?ID=2823cl=1/link
 Just yesterday I discovered a program called XML Spy which you can get on a
 30-day eval from www.tucows.com.  This was what pointed out the error to me
 in your file.

Interesting..  So to be consistent with proper XML formatting, should the server 
hosting the XML file convert the  into amp; ?

 When I was using XSL last year for the first time, I had a devil of a time
 figuring out how to get URLs, particularly with query strings attached,
 through the XML parsers.  Try using the %codes in your URLs instead of  and
 other special characters; that should help, if I remember correctly.
 (Similarly, building HREF tags using XSL stylesheets seemed pretty awkward,
 but I'm sure I was missing some crucial tidbit of information.)

I certainly feel like I'm missing something...  Although I'm a bit at odds as to how 
to troubleshoot this new file.

I no longer get the errors, but I'm not getting the results I'm looking for either.

The updated script is running here:
http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php

I've also attached the full script (since I've made some changes to it).

Any additional help would be appreciated.

Mike

 Mike Gifford [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
 Hello,
 
 In looking for a good script to parse XML files I stumbled across the
 
 following
 
 tutorial (which looks very good):
 http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html
 
 I have set this script up here:
 http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php
 
 and I keep getting the following error (even after making a number of
 
 changes):
 
 XML error: not well-formed at line 16
 
 And I'm not sure how to troubleshoot this problem.
 
 I'm assuming that it is referring to line 16 on the XML file, in this
 
 case:
 
 http://cupe.ca/xml/cupenews.rdf
 
 My parsing definitions are as follows
$itemTitleKey = ^rdf^item^title;
$itemLinkKey = ^rdf^item^link;
$itemDescKey = ^rdf^item^description;
 
 Any help would be appreciated.
 
 Mike


?php

class xitem {
   var $xTitle;
   var $xLink;
   var $xDescription;
  // function xitem() {
  // }
}

// general vars
$sTitle = Airline Division Newsfeeds;
$sLink = http://airdiv.cupe.ca/portal/;;
$sDescription = A Portal for the Airline Division of CUPE;
$arItems = array();
$itemCount = 0;

// * Start User-Defined Vars 
// rss url goes here
$uFile =http://cupe.ca/xml/cupenews.rdf;;
// descriptions (true or false) goes here
$bDesc = ; // If it exists this should be 'true'
// font goes here
$uFont = Verdana, Arial, Helvetica, sans-serif;
$uFontSize = 2;
// * End User-Defined Vars **

function startElement($parser, $name, $attrs) {
   global $curTag;   $curTag .= ^$name;
}

function endElement($parser, $name) {
   global $curTag;   $caret_pos = strrpos($curTag,'^');
   $curTag = substr($curTag,0,$caret_pos);
}

function characterData($parser, $data) {
global $curTag; // get the Channel information first
   global $sTitle, $sLink, $sDescription;
//  $titleKey = ^RSS^CHANNEL^TITLE;
//  $linkKey = ^RSS^CHANNEL^LINK;
//  $descKey = ^RSS^CHANNEL^DESCRIPTION;
   $titlekey = ^rdf:RDF^channel^title;
   $linkkey = ^rdf:RDF^channel^link;
   $desckey = ^rdf:RDF^channel^description;
   if ($curTag == $titleKey) {
 $sTitle = $data;
 echo  $sTitle;
   }
   elseif ($curTag == $linkKey) {
 $sLink = $data;
  echo  $sLink;
   }
   elseif ($curTag == $descKey) {
 $sDescription = $data;
   }   // now get the items
   global $arItems, $itemCount;
//  $itemTitleKey = ^RSS^CHANNEL^ITEM^TITLE;
//  $itemLinkKey = ^RSS^CHANNEL^ITEM^LINK;
//  $itemDescKey = ^RSS^CHANNEL^ITEM^DESCRIPTION;
   $itemtitlekey = ^rdf:RDF^item^title;
   $itemlinkkey = ^rdf:RDF^item^link;
   $itemdesckey = ^rdf:RDF^item^description;
if ($curTag == $itemTitleKey) {
 // make new xitem
 $arItems[$itemCount] = new xitem(); // set new item object's 
properties
 $arItems[$itemCount]-xTitle = $data;
 echo $data;
   }
   elseif ($curTag == $itemLinkKey) {
 $arItems[$itemCount]-xLink = $data;
 echo $data;
   }
   elseif ($curTag == $itemDescKey) {
 $arItems[$itemCount]-xDescription = $data;
 // increment item counter
 $itemCount++;
 echo $data;
   }

} // main loop

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, startElement, endElement);
xml_set_character_data_handler($xml_parser, characterData);
if (!($fp = fopen($uFile,r))) {
   die (could not open RSS for input);
}
while ($data = fread($fp, 4096)) {
$data=eregi_replace( , amp;,$data);
echo $data;
   if 

Re: [PHP] PHP XML Parsing

2001-05-18 Thread Peter Dudley

The problem is in your link URL, where you pass CGI parameters.  When XML
sees the  character, it assumes it's a special character thing such as
amp; or quot;, so it's expecting a semicolon.

linkhttp://cupe.ca/news/cupenews/showitem.asp?ID=2823cl=1/link

Just yesterday I discovered a program called XML Spy which you can get on a
30-day eval from www.tucows.com.  This was what pointed out the error to me
in your file.

When I was using XSL last year for the first time, I had a devil of a time
figuring out how to get URLs, particularly with query strings attached,
through the XML parsers.  Try using the %codes in your URLs instead of  and
other special characters; that should help, if I remember correctly.
(Similarly, building HREF tags using XSL stylesheets seemed pretty awkward,
but I'm sure I was missing some crucial tidbit of information.)

Pete.

Mike Gifford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 In looking for a good script to parse XML files I stumbled across the
following
 tutorial (which looks very good):
 http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html

 I have set this script up here:
 http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php

 and I keep getting the following error (even after making a number of
changes):
 XML error: not well-formed at line 16

 And I'm not sure how to troubleshoot this problem.

 I'm assuming that it is referring to line 16 on the XML file, in this
case:
 http://cupe.ca/xml/cupenews.rdf

 My parsing definitions are as follows
$itemTitleKey = ^rdf^item^title;
$itemLinkKey = ^rdf^item^link;
$itemDescKey = ^rdf^item^description;

 Any help would be appreciated.

 Mike




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP XML Parsing

2001-05-18 Thread Fabian Raygosa

for xml you have to escape certain characters in the file, one is the
ampersand ...
- Original Message -
From: Mike Gifford [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 18, 2001 12:24 PM
Subject: [PHP] PHP  XML Parsing


 Hello,

 In looking for a good script to parse XML files I stumbled across the
following
 tutorial (which looks very good):
 http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html

 I have set this script up here:
 http://www.airdiv-cupe.org/portal/newsfeed_new_parser.php

 and I keep getting the following error (even after making a number of
changes):
 XML error: not well-formed at line 16

 And I'm not sure how to troubleshoot this problem.

 I'm assuming that it is referring to line 16 on the XML file, in this
case:
 http://cupe.ca/xml/cupenews.rdf

 My parsing definitions are as follows
$itemTitleKey = ^rdf^item^title;
$itemLinkKey = ^rdf^item^link;
$itemDescKey = ^rdf^item^description;

 Any help would be appreciated.

 Mike
 --
 Mike Gifford, OpenConcept Consulting, http://openconcept.ca
 Offering everything your organization needs for an effective web site.
 Featured Client: http://halifaxinitiative.org
 A good life is one inspired by love and guided by knowledge - B. Russell


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]