Re: [Xml-coreutils-discuss] Problem using xml-grep
Status: Alpha
Brought to you by:
lbreyer
From: Laird B. <la...@lb...> - 2010-09-13 23:11:35
|
On Sep 13 2010, Douglas Held wrote: > All right, I built 0.8b and the symptom looks similar. Please let me > know what debugging information I can provide. Thanks! Thanks, now we're ready to talk :) > douglas-helds-macbook-pro-2:2010Q3 douglasheld$ cat core_java.xml | > xml-grep --subtree 'ControlflowRule' > xml-grep: error: segmentation fault. This is a bug in xml-grep. I can only track it down if I have a sample XML which triggers it. Since you can't show me the XML, you can try giving me a stack trace in gdb if you're comfortable with that. gdb --args xml-grep 'ControlflowRule' core_java.xml Type "run", and after it segfaults, type "where". > douglas-helds-macbook-pro-2:2010Q3 douglasheld$ xml-cat core_java.xml > | xml-grep --subtree 'ControlflowRule' > <?xml version="1.0"?> > <root> > > > > > > > > > > > > </root> > douglas-helds-macbook-pro-2:2010Q3 douglasheld$ cat core_java.xml | > grep -m 1 'ControlflowRule' > <ControlflowRule formatVersion="3.2" language="java"> This is correct (ie intended) output. The xml-grep doesn't grep the tags, but only the strings in attributes or text nodes. For example, you should be able to get the output you expect with xml-cat core_java.xml | xml-grep '3.2' Most commands accept an XPATH type expression that lets you drill down in the tree structure. Some other commands that might do what you're looking for in your example are xml-ls '://ControlflowRule' 'core_java.xml' xml-cp 'core_java.xml' '://ControlflowRule[1]' stdout Laird. -- http://www.lbreyer.com The mind boggles, but does the Boggle mind? The mind boggles... |