user3718819
user3718819

Reputation: 1

xpath, I have to do a complex query

I am learning xpath and i have some problems to make some query

This is my dtd:

<! DOCTYPE database[
<! ELEMENT database(Customer*, Stock*, Zone*, Machine*, Seller*)>
<! ELEMENT Customer(social_id)>
<! ELEMENT Machine(name_machine)>
<! ELEMENT Seller(name_seller, cell-phone, email)>
<! ELEMENT Stock(howmany)>
<! ELEMENT ZOne(name_zone)>

<! ATTLIST Customer 
        id_customer ID #REQUIRED,
        id_zone IDREF #REQUIRED,
        id_seller IDREF #REQUIRED>

<! ATTLIST Machine id_machine ID #REQUIRED>

<! ATTLIST Seller   id_seller ID #REQUIRED>

<! ATTLIST Stock
        id_customer IDREF #REQUIRED,
        id_machine IDREF #REQUIRED,
        howmany CDATA #REQUIRED>

<! ATTLIST ZOne id_zone ID #REQUIRED>

<! ELEMENT name_machine (#PCDATA)>
<! ELEMENT name_seller (#PCDATA)>
<! ELEMENT name_zone (#PCDATA)>
<! ELEMENT email (#PCDATA)>
<! ELEMENT cell-phone (#PCDATA)>
<! ELEMENT social_id (#PCDATA)>]

And the query that i must do is: 1) get the customer's cellphone from some zone (particulary just one)

thanks for your help, im am learning englist too, Im sorry if a wrote something really wrong

Upvotes: 0

Views: 40

Answers (1)

mdev
mdev

Reputation: 63

First, I would create an XML file that obeys the DTD you have, then find an application that allows you to experiment with XPath expressions, start with root // and get all nodes, then work your way down to nodes you need to select.

Upvotes: 1

Related Questions