php,dom, xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • renoua
    New Member
    • Jun 2010
    • 11

    php,dom, xml

    Helliio,


    I have a xml file that has 106 books.
    Each book has an id.
    Every time that a user selects a writer from suggestions, I would like to present the id's of the books that he wrote on my page.


    $w has the name of a writer that user selects

    Code:
    $w = $_GET['node'];
    At my xml file writers have that xpath:

    Code:
    /ead/archdesc/dsc/c01/bibliography/bibref
    and the id's of every book:

    Code:
    /ead/archdesc/dsc/c01/did/unitid

    Any ideas?

    thnx in advance :)
    Last edited by Dormilich; Jul 5 '10, 06:13 AM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    the principle is simple. in the XPath, set a condition whose value is fed by a variable/parameter.

    what you need is a relation between the writer and the book id (in the XML). without that it’s near impossible to get the matches.

    Comment

    Working...