Schultz, Gary - COMM schrieb:

Hello,

> I have cinclude working so that I can get all of the specific
> elements from an XML file. What I have not found a way to do is get
> the 2nd, 3rd, 4th, etc. element or get an element by attribute value.
> I have found nothing in Cocoon wiki to explain how one uses cinclude
> to include only a part of the XML file.
>
> For example, I can use the following to get all paragraph elements in
> an xml file:
>
> <cinclude:include
> xmlns:cinclude="http://apache.org/cocoon/include/1.0";
> src="http://localhost/something.xml";
> select="//*[local-name()='paragraph']/."/>
>
> But what I want is to get a specific paragraph element from the file.
> Any direction on this is greatly appreciated.

You need to be more precise in your xpath expression:

 //[EMAIL PROTECTED]'ABC123']

chooses all paragraphs with an attribute var that equals 'ABC123'.

 paragraph[1]

chooses the first occurence of paragraph.

HTH
Christoph

Attachment: pgp1V8Ai5NIxP.pgp
Description: PGP signature

Reply via email to