Hi Henrik,

How about this:

let $x := <outernode>This is a <span class="heavy ">very</span> rainy night in 
Copenhagen</outernode>
return $x/node()

This will return all of the nodes (text and element in this case) that are 
children of <outernode>.

-Danny

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Henrik Thiil 
Nielsen
Sent: Sunday, August 26, 2012 2:54 PM
To: [email protected]
Subject: [MarkLogic Dev General] Complex type instead of escaped html in simple 
type

Dear MarkLogicians,

Unfortunately I have to have HTML mark-up in some nodes in my XML documents.

Currently those nodes are string simpletypes with  embedded escaped HTML
tags. 
I would prefer to turn them into complextypes and replace the escaped HTML 
tags with proper XML subnodes, but I only know how to retrieve the contents 
as text without the sub-node tags (but with the text inside the latter)  or
with
 the sub-node tags included as text. How can I retrieve the contents of the
node 
as text and have the sub-node interpreted as (X)HTML?

Given:-

<outernode>This is a <span class="heavy ">very</span> rainy night in
Copenhagen</outernode>

I know how to get:-

This is a <span class="heavy ">very</span> rainy night in Copenhagen    (as
text)

And also:-

This is a very rainy night in Copenhagen        (as text and with no
special formatting of "very")

But I want to get:-

This is a very rainy night in Copenhagen        (as text with "very" in bold
type assuming I have the proper CSS)



Thanking you in advance,

Henrik Thiil Nielsen

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to