empty element (sort of)

I’m looking for a way to find horizontal tabulations (unicode 0009) in ‘empty’ elements.

I’ve tried the following xquery:

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
for $a in input()/self_test
where tf:containsText($a//emphasis, " ")
return $a/@identifier

It seems as if this xquery returns all documents. Because when I use … where tf:containsText($a//emphasis, "
"), I get the same amount of documents.

I’ve studied the tamino documentation on transliteration (Unicode and text retrieval) and I wonder if it’s possible to add a tabular stop (as a character) to the existing transliteration. I did a first attempt, but I wasn’t successful. It seemed as if tamino ignored the query.
Am I thinking into the right direction? Would this be the right way to be able to search for tabular stops?

One other thing, on the W3C-site (http://www.w3.org/TR/2004/WD-xquery-20041029/#doc-xquery-SequenceType) I found that it should be possible to search for unicode characters in an xquery. The search string could for example look like “€99.50” when you’re searching for “?99.50”. Could I get this to work in tamino? If I create a query like:

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
for $a in input()/self_test
where tf:containsText($a//emphasis, “&#0009*”)
return $a/@identifier

I get error code “INOXIE8306 Invalid cursor position”

I would be very grateful if someone could advise me.

You could do it like this:

   for $a in input()/self_test
   where contains($a//emphasis, "	")
   return $a/@identifier


Be aware that there is no index support for the contains() function.

No problem with a literal Euro sign, provided you are using a proper encoding for your request. Of course you could use a character reference (“€”) again to circumvent encoding problems.

[This message was edited by Gunther Rademacher on 04 February 2005 at 16:30.]

Hi,

yo write


I’ve tried the following xquery:

declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
for $a in input()/self_test
where tf:containsText($a//emphasis, " ")
return $a/@identifier

It seems as if this xquery returns all documents. Because when I use … where tf:containsText($a//emphasis, "
“), I get the same amount of documents.


yes, * stands for a single word in this case, because U+0009 is a separator by default.

You can search for U+0009 if you add the following to ino:transliteration:
<ino:character ino:class=“single” ino:value=” “/>

Remember to recreate all text indexes involved.

Then an XQuery such as
declare namespace tf=“http://namespaces.softwareag.com/tamino/TaminoFunction
for $i in input()/*
where tf:containsText($i,” ")
return $i

will be successful.


Regards

Harald

Thanks to your replies I’ve done some additional experiments and I’ve seen the proof with my own eyes.

I’ve made a test-document, containing the EURO-sign (utf-8 encoding). I got back the right document with xquery…where tf:containsText($a, “€”)…

But as you wrote, the horizontal tabulation is a tricky one. Guess I’ll have to work on my transliteration-modification-skills.

Regards, Bart

Of course I wanted to write:
I’ve made a test-document, containing the EURO-sign (utf-8 encoding). I got back the right document with xquery…where tf:containsText($a, “€”)…

instead of



Bart.