Re: [Xml-coreutils-discuss] Where to start?
Status: Alpha
Brought to you by:
lbreyer
From: <la...@lb...> - 2015-02-12 14:03:21
|
On 2015-02-12 07:20, Douglas Held wrote: >>> Goal: >>> I would like to extract only listings with floor plans, and only the >>> selected elements I am interested in, into a new document as: >>> <listings> >>> <listing> >>> <listing_id>1</listing_id> >>> <floor_plan>http://example.com/123456</floor_plan> >>> </listing> >>> <listings> >>> >>> I have tried commands such as: >>> # Create the target file >>> xml-echo -e "[listings@updated=20150210]" >listings.xml >>> # Copy selected elements into target >>> xml-cp page1.xml >>> :/response/listing/listing_id[/response/listing/floor_plan != null] >>> listings.xml :/listings/ I would not expect this to succeed as the condition in [] requires more advanced processing than xml-cp is currently coded to do. Perhaps an extension of xml-grep could handle this. I will have to think about it. Cheers, Laird Breyer |