Small request on xquery ( how to put xml content in a attribute element )
Hello, I'm using basex to manage numerous collection of xml structure , in the context of a migration program, i will transfer these structure to an external system , so i need to send them within an embedded attribut value ( of a xml ) : ex: BaseX current content is : <NodeX></NodeX> Remote DataBase ( not xml ) requieres : <Value title="FNX" value="<NodeX></NodeX>"> The XML source is translated to a litteral string ....but what is the function ( Cast ? ) responsible to operate the translation ? By the way , what is the reversed operation that read attribut to XML structure . Best Regards
BaseX current content is : <NodeX></NodeX>
Remote DataBase ( not xml ) requieres : <Value title="FNX" value="<NodeX></NodeX>">
This can be done with the fn:serialize() function: (: start :) <Value title="FNX">{ serialize(<NodeX></NodeX>) }</Value> (: end :) Note that you'll have to prefix your query with a "xhtml" output method declaration if you want to explicitly see the opening and closing tag: (: start :) declare option output:method "xhtml"; <Value title="FNX">{ serialize(<NodeX></NodeX>) }</Value> (: end :) Best, Christian
Hi, Am 02.06.2011 19:06, schrieb augras philippe:
The XML source is translated to a litteral string .... [...] By the way , what is the reversed operation that read attribut to XML structure .
That can be done with the function fn:parse-xml(...):
parse-xml('<NodeX></NodeX>') ==> <NodeX/>
Cheers, Leo
participants (3)
-
augras philippe -
Christian Grün -
Leo Wörteler