xml xquery and php



I am new to XML. Initially I was saving all the settings in either PHP
or text files or database tables and use to parse the config variables
from files or query from the database. Now I want to keep all the
settings in the XML file and get the setting values, user datas (as
database is not involved and all the results are stored in XML file
itself) from it.

Referring to http://www.w3schools.com/xquery/xquery_example.asp, it
gives sample xml file and also query. But I don't know how to execute
it.
-------------------------------------------------------------------------------------------------------------

"books.xml":

<?xml version="1.0" encoding="ISO-8859-1"?>

<bookstore>

<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>

<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>

<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>

<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>

</bookstore>

-------------------------------------------------------------------------------------------------------------

doc("books.xml")/bookstore/book[price<30]

The XQuery above will extract the following:

<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>

-------------------------------------------------------------------------------------------------------------

I have a PHP 5 installed on the computer. I want to know, provided the
XML file, how do I execute the query and get the results. Are there
some API, Packages avaailable.

Please also suggest XML user groups.

Thanks.

Manish

.



Relevant Pages

  • Re: Why PHP?
    ... > Try parsing and building an XML document natively in FC. ... Also, PHP is ... SQL support is ... any of the other database systems, ...
    (comp.databases.pick)
  • Re: Event-oriented genealogy software for Linux
    ... Eventually they got a contract for a much more complex document type than they'd handled previously, in fact the contract called for two different documents. ... Clearly this was a trend - XML would be the basis for contracts in the future. ... The next stage would be hard-coded to take apart the structure, put the house-keeping info into a database but the document-specific XML fragments would be stored unchanged in a text field in the database. ... that the hierarchies will be time-dependent and make provision for optional start and finish dates. ...
    (soc.genealogy.computing)
  • Re: Quick Question: Automating an XML download Import
    ... insert it into the database, am I going to be able to schedule the php ... script to run with CRON? ... I would like to automate a script that will download an XML file from a ...
    (php.general)
  • Re: DISCOVER_XML_METADATA
    ... expansion of ASSL XML returned by the server. ... You could do ExpandObject for the server in step 1. ... you could request ExpandObject for that database -- this is step ... all cubes and nothing else. ...
    (microsoft.public.sqlserver.olap)
  • Re: Preservation of namespace prefixes in XML datatype
    ... representation well beyond merely preserving the logical meaning. ... > Now the ANSI/ISO SQL-2003 standard makes it pretty clear that the XML ... all the guarantee the database gives you is that we preserve the ... >> makes changes in namespace prefixes, will I the user/developer have the ...
    (microsoft.public.sqlserver.xml)