[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

how to construct XML via strings

Alexander Boldakov boldakov at ispras.ru
Fri Oct 6 14:09:31 PDT 2006


  how to construct XML via strings
Hi all,

I'm a colleague of Maxim Grinev. I wan't to thank everyone for useful
answers and tell a few words about our use case.

We have an external full-text search system which is used to search
and hightlight results in the XML data. This is where foreign function
interface is used. The highligh function returns string - serialized
XML data with additional tag <hit>, ie something like this:

"<data>In the result some <hit>text</hit> is marked with tag</data>"

It is required to construct XML data with this fragment inside and
return the whole result as XML (to process via XSLT).

("<result>",
    <meta>{...some XQuery expression...}</meta>,
    "<data>In the result some <hit>text</hit> is marked with
    tag</data>",
 "</result>")

We understand the solution with additional function that parses the
string into internal representation, but we believe that in our case
it leads to unacceptable extra overhead, because this strings are big
and contain a lot of tags.
 
We've looked through the output methods of "XSLT 2.0 and XQuery 1.0
Serialization" and found out that all methods doesn't satisfy our aims.
With XML,XHTML,HTML output method the "<" ">" symbols are escaped,
with TEXT method all tags will be lost.

The only solution we find to follow the standards is to use "Character
Maps". We are able to change the highlighting function to change
symbols "<" and ">" around tags with some specific symbols. If we
understand specification correctly, what we need after this is to
define character mapping of this special symbols to "<" and ">"
respectively.

But we cannot find the syntax construction in XQuery to define
character mappings? Are they implementation depended?

Is character mapping the right choise in our use case?



Alexander Boldakov
Sedna team
http://x-query.com/mailman/listinfo/talk















-- 
С уважением,
 Alexander                          mailto:http://x-query.com/mailman/listinfo/talk





Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.