[MarkLogic Dev General] storing a html 'as it is' in xml

2013-02-12 Thread Raghu
Hi All,

Im trying to store a html with empty tags say

html
span class=someclass/span
span class=someclass/span span class=someclass/span
span class=someclassSome text/span
/html

After storing in marklogic I get

html
span class=someclass/
span class=someclass/
span class=someclass/
span class=someclassSome text/span
/html


It is also stripping the spaces and line breaks
And this is causing issues while rendering as html in a few browsers
Is there a way I can store it as it is??
I've tried

declare boundary-space preserve;

declare option xdmp:output indent=no;

 but still no luck

OTHER THAN CDATA/ Binary is there any other way to do this?

Any help is appreciated

Thanks in advance!

Raghu
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] storing a html 'as it is' in xml

2013-02-12 Thread Mary Holstege
On Tue, 12 Feb 2013 15:48:01 -0800, Raghu  
raghupathy.visweswa...@gmail.com wrote:

 It is also stripping the spaces and line breaks
 And this is causing issues while rendering as html in a few browsers
 Is there a way I can store it as it is??

Only if you store it as a binary or plain text document, in which case
you will not be able to do path expressions over it. We don't store
the text of documents, we store an efficient representation of the
data model.

 I've tried

 declare boundary-space preserve;

 declare option xdmp:output indent=no;

  but still no luck

 OTHER THAN CDATA/ Binary is there any other way to do this?

 Any help is appreciated

 Thanks in advance!

 Raghu


I would suggest setting the output method to either HTML or XHTML, so
that the serialization is appropriate for your use:

declare option xdmp:output method=html;

//Mary
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general


Re: [MarkLogic Dev General] storing a html 'as it is' in xml

2013-02-12 Thread Damon Feldman
Raghu,

MarkLogic does not store the actual characters in the markup - it stores an 
optimized version of the document and serializes it back out per the XML spec.

However, MarkLogic knows about the XHTML schema, which prohibits some 
self-closing tags like span/. If you put your content in the right namespace 
it should serialize in a way browsers accept. Try this query in queryConsole to 
see the difference between the XHTML namespace and xml that looks enough like 
XHTML to be rendered but is not actually xhtml:

div xmlns=http://www.w3.org/1999/xhtml;/div
,
div xmlns=http://foo;/div

In my version (6.0-2) the former serialized with an explicit close tag but the 
latter serializes as a self-closing tag.

Yours,
Damon
--
Damon Feldman
Sr. Principal Consultant, MarkLogic

From: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Raghu
Sent: Tuesday, February 12, 2013 6:48 PM
To: General MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] storing a html 'as it is' in xml

Hi All,

Im trying to store a html with empty tags say

html
span class=someclass/span
span class=someclass/span span class=someclass/span
span class=someclassSome text/span
/html

After storing in marklogic I get

html
span class=someclass/
span class=someclass/
span class=someclass/
span class=someclassSome text/span
/html


It is also stripping the spaces and line breaks
And this is causing issues while rendering as html in a few browsers
Is there a way I can store it as it is??
I've tried


declare boundary-space preserve;

declare option xdmp:output indent=no;

 but still no luck

OTHER THAN CDATA/ Binary is there any other way to do this?

Any help is appreciated

Thanks in advance!

Raghu
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general