sanjay
sanjay

Reputation: 1020

XSLT - select processing instruction nodes that has a value

I need to select processing instruction that has a value.

example:

<doc>
    <?aaa?>
    <?aaa bbb?>
</doc>

above example, I can select both pi using //processing-instruction('aaa') xpath. any idea how can I select pi that has a value. (this example, only should be selected)

Upvotes: 0

Views: 51

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167446

Use //processing-instruction('aaa')[normalize-space()].

Upvotes: 2

Related Questions