Saturday 15 September 2012

command line - Select XML element based on the value of a tag -


Let me see all the & lt; Style & gt; Blocks must be selected from a KML that has color ccff00ff . Something like this:

  & lt; Style id = "inline" & gt; & Lt; LineStyle & gt; & Lt; Color & gt; Ccff00ff & lt; / Color & gt; & Lt; Width & gt; 5 & ​​lt; / Width & gt; & Lt; / LineStyle & gt; & Lt; / Style & gt;   

I'm dashing my head for hours against the wall, and it can be found closest on the following grounds:

  Xmlstarlet sel-n 'ns = http: //www.opengis.net/kml/2.2' -t '' // ns: style [.// ns: color [in it (text (), 'ccff00ff' ) Unfortunately, if I change the  ccff00ff  as I want, it still matches, so I think it does not work at all. !   

  '// ns: style [.// ns: color [in it (text ( ), 'Ccff00ff')] '  

quote nest; Use double quotes inside a single:

  '// ns: style [.// ns: color [in it (text (), "ccff00ff")]]'   

The example that you linked did have other types of quotes, because cmd.exe does not recognize single quotes by citing characters. Since bases recognize double quote marks by citing characters, so you can do this like this, but they are "soft quotes" so you can go with it in some trouble. As far as Exception is concerned, both kinds of quote types are completely identical.

No comments:

Post a Comment