I'm trying to test whether an element in a defined list (array) is "empty." I tried using the \empty macro, or putting white spaces inside the quote, but nothing seems to work. I'm testing the emptiness of each element using the etoolbox \ifboolexpr construct with test (also, I tested \notblank with the same results), although I'm not sure if the fault lies in the conditional evaluation or in the \pgfmathparse that retrieves the element from the array.
Thus, what is the correct way of checking if the element is empty and branching into the else part of the conditional.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{etoolbox}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\def\n{5}
\def\weights{{"1","2","3","4","","n"}}
\foreach \i [count=\c] in {0,...,\n}{
\pgfmathparse{\weights[\i]} \let\label\pgfmathresult
\ifboolexpr{ not test{\ifstrempty{\label}} }{%
\node at (0,\c) {$l_{\label}$};
}{ %
\node at (0,\c) {empty};
}
}
\end{tikzpicture}
\end{document}


