I am very new to XQuery and frankly believe that the learning curve is incredibly steep.
I have an XML structure that looks something like this:
<root>
<product>
<size>500 units</size>
</product>
<product>
<size>1000 units</size>
</product>
<product>
<size>Unlimited units</size>
</product>
</root>
I need to write XQuery statement that returns all the nodes where the numerical value of the size of less than 1000. So I somehow need to specify a numerical value (ignoring any text) to perform the "le" I guess.
In addition, there is a possibility that the node will not have any digits (for example, "Unlimited Units"), in which case it should be considered as having a value of 1,000,000.
? fn: replace (blah, '\ D', '') xs: int, .
.