[MarkLogic Dev General] Complex type instead of escaped html in simple type

Danny Sokolsky Danny.Sokolsky at marklogic.com
Sun Aug 26 15:12:17 PDT 2012


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: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Henrik Thiil Nielsen
Sent: Sunday, August 26, 2012 2:54 PM
To: general at developer.marklogic.com
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
General at developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


More information about the General mailing list