Hallo there.

I have the following XML

<coordenadoria>
  <disciplina class="X" cod="AM123">
      ...blablabla
  </disciplina>
  <disciplina class="X" cod="AM123">
      ...blablabla
  </disciplina>
</coordenadoria>

Now, i have two kinds of 'selecs' i can do. I can choose a Discipline by its Cod, or its Cod+Class.

using the following code, i can choose its Cod only.

String path = "//coordenadoria";
path += "//disciplina[@cod='"+disc+"']"

Now, im having trouble with that AND operator.
How could i perform an And? Heres what ive tryed:

path += "//disciplina[@cod='"+disc+"'] and //disciplina[@turma='"+turma+"']";

Thanx for any help, and for your attention.

[]´s Gabriel Ziden

To select by class and cod attributes:

String path = "//coordenadoria/disciplina[@cod='"+disc+"' and @class='"+turma+"']";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.