[Dev] Interface Up/Down
Leo Bayer
lbayer at alterpoint.com
Sun May 18 02:37:39 CDT 2008
Couldn't you try something like...
xpath=reverse(/ZiptieElementDocument//interface//adminStatus/text()|/
ZiptieElementDocument//interface//name/text())
There are a lot of crazy xpath functions to do almost anything.
- Leo
On May 17, 2008, at 11:45 PM, Brett Wooldridge wrote:
> Ryan,
>
> I “fixed” (read “broke”) your interface up/down tool. It now uses a
> new ‘grid’ input contributor which uses XPath to populate the grid
> with both the current up/down status of the interface as well as the
> interface name in a grid. Probably broke in this case, because the
> input generated by the grid tool is a CSV for each selected item in
> the grid (I’m trying not to get too tricky by allowing specific
> column input determination).
>
> So in the case of the ‘old’ list input it was using, if there was a
> list like so:
>
> loopback0
> loopback1
> fastethernet0
>
> Your tool might get:
>
> “loopback0”,“fastethernet0”
>
> as it’s input. In the case of the new grid control the grid
> contains something like
>
> up loopback0
> down loopback1
> up fastethernet0
>
> In which case, your tool input will be a properly escaped CSV like so:
>
> “up,loopback0”,”down,fastethernet0”
>
> Obviously, your tool can choose to ignore the current up/down status
> reflected in the input, but will have to deal with it enough to know
> to ignore it.
>
> If you play around with it you’ll note that there is no way using
> XPath with our document structure to generate a grid like so:
>
> loopback0 up
> loopback1 down
> fastethernet0 up
>
> This is because of our decision to use ‘tags’ rather than
> ‘attributes’ on nodes like interface. If they were attributes we
> could chose the selection order, but as nodes the result will always
> be in “document order” and because “adminStatus” occurs before
> “name” in the document it will always be emitted first by XPath.
> Cest la vie.
>
> Anyway, sorry for breaking your tool. It was for the greater good
> of mankind.
>
> -Brett
> <ATT00001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ziptie.org/pipermail/dev/attachments/20080518/7295992d/attachment.html
More information about the Dev
mailing list