Hi!

I am mapping some XML feed elements to a custom content type (cck) Everything is going fine except when I am trying to map some nodes with attributes. Let me put an example.

XML File


<book>
	<book>
		<title>Winnie the Pooh</title>

		<reviews>
			<review lang="en_GB">Great Book</review>
			<review lang="es_ES">Tremendo libro</review>
		</reviews>
	</book>
</books>

I just want to extract the review node with the attribute "en_GB"

I used:

/book/books/reviews/review[@lang='en_GB']

and

/book/books/reviews/review[1]

The node field returns empty.

The other mapping works just perfect

Example: /books/book/title

Any suggestions?

Comments

avantwaves’s picture

Title: Mapping XML node attributes to nodes. » Mapping XML node attributes to Drupal nodes.
hanno’s picture

Maybe you need an extra slash, worked for me in another situation with attributes. will this do?:
/book/books/reviews/review/[@lang='en_GB']

avantwaves’s picture

Thanks Hanno, unfortunately that didn't work... :( I will try installing the dev version of the module and I will report back.

Wait! I think that this module don't have a dev version! :)

avantwaves’s picture

I installed the dev version of feeds_xpathparser and this is working pretty well.

//review/[@lang='en_GB']
alex_b’s picture

Project: Feeds » Feeds XPath Parser
Version: 6.x-1.0-beta2 » 6.x-1.x-dev

Wrong issue queue?

avantwaves’s picture

Status: Active » Closed (fixed)
hanno’s picture

great that it is working now.