Preserving Namespaces in the root HTML node of Editable Documents

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Preserving Namespaces in the root HTML node of Editable Documents

Douglas Hurbon
Hello all,

Maybe somebody has a way to accomplish this.  Our legacy content depends upon a set of custom namespaces in the root HTML node of our documents. 

For example:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" >


// rest of document


</html>


 I'd like to be able to preserve those namespaces in Hippo CMS 7.7.  I've tried modifying the cleaner.config, adding:

  • hippohtmlcleaner:attributes: xmlns
To the already existing:
  • hippohtmlcleaner:name: html

But after an edit in Xinha (which at least receives the namespaces with this.fullPage = true) the document looks like:

<html>

// rest of document

</html>

Is there some way to turn off the hippoHTMLcleaner completely?  Is it getting stripped in Xinha?

Thanks,

-doug

The City University of New York



_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Preserving Namespaces in the root HTML node of Editable Documents

Mathijs Brand
Hi Doug,

thanks a lot for your question. In general it's not a great idea to
turn off the html cleaner, but to allow elements you don't want to be
filtered out.

Now in your case you say you need to preserve namespaces which are not
easily preserved. Could you elaborate a bit more on why you need them?
There could be better solutions.

Kind regards,
Mathijs Brand


On Wed, Feb 1, 2012 at 1:31 PM, Douglas Hurbon
<[hidden email]> wrote:

> Hello all,
>
> Maybe somebody has a way to accomplish this.  Our legacy content depends
> upon a set of custom namespaces in the root HTML node of our documents.
>
> For example:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:dc="http://purl.org/dc/elements/1.1/" >
>
>
> // rest of document
>
>
> </html>
>
>
>  I'd like to be able to preserve those namespaces in Hippo CMS 7.7.  I've
> tried modifying the cleaner.config, adding:
>
> hippohtmlcleaner:attributes: xmlns
>
> To the already existing:
>
> hippohtmlcleaner:name: html
>
>
> But after an edit in Xinha (which at least receives the namespaces
> with this.fullPage = true) the document looks like:
>
> <html>
>
> // rest of document
>
> </html>
>
> Is there some way to turn off the hippoHTMLcleaner completely?  Is it
> getting stripped in Xinha?
>
> Thanks,
>
> -doug
>
> The City University of New York
>
>
>
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Preserving Namespaces in the root HTML node of Editable Documents

Jeroen Reijn
Administrator
In reply to this post by Douglas Hurbon
Hi Douglas,

as far as I know it's not possible right now with the HTML cleaner. Are your legacy document put entirely into one single HTML field in Hippo? Most of the time the actual namespace is put in the actual html output that contains the dc namespace.

Could you perhaps describe your content model a bit more? Otherwise you might need to change the HTML cleaner, but I do not know if it has knowledge of namespaces right now.

Cheers,

Jeroen   

On Wed, Feb 1, 2012 at 7:31 PM, Douglas Hurbon <[hidden email]> wrote:
Hello all,

Maybe somebody has a way to accomplish this.  Our legacy content depends upon a set of custom namespaces in the root HTML node of our documents. 

For example:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" >


// rest of document


</html>


 I'd like to be able to preserve those namespaces in Hippo CMS 7.7.  I've tried modifying the cleaner.config, adding:

  • hippohtmlcleaner:attributes: xmlns
To the already existing:
  • hippohtmlcleaner:name: html

But after an edit in Xinha (which at least receives the namespaces with this.fullPage = true) the document looks like:

<html>

// rest of document

</html>

Is there some way to turn off the hippoHTMLcleaner completely?  Is it getting stripped in Xinha?

Thanks,

-doug

The City University of New York



_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html


_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Preserving Namespaces in the root HTML node of Editable Documents

Douglas Hurbon
Thanks for the replies.

We have a lenya/cocoon based system whose base documents are XML, not xhtml.  Our current goal is to make the two systems, the cocoon based system and Hippo, work together during our transition into Hippo.

Right now, I have built a source factory thats plugged into the Cocoon source resolver that resolves URLs of the form "hippo://" to nodes in the hippo repository.  That's all working very well.  Our old system can read and modify its own content stored in the repo, and the Hippo CMS is happy too.

The Avalon Source actually rips our XML documents apart, storing the non XHTML content as String nodes attached to the document in the repo, and storing the XHTML content in separate node.  The original form of the XML document is reconstituted it when it's read.  That also is working fine.

The problem comes when one of our documents has an XHTML node in the body content that has a namespace prefix in it. As long as the document isn't edited in with Hippo/Xinha, there aren't any problems.  But if the document is edited, the namespaces are stripped, and the Xerces xml parser complains that the document is invalid, as it contains an undeclared namespace prefix.

I suppose I could store the namespaces from each document as a set of nodes, and slam them back into the <html> tag BEFORE I give it to Xerces for parsing.

Will the HTML cleaner allow non XHTML tags?  Like <myspace:mytag  foo="bar" />?  We have a lot of those too.  :-/  I tried to add a few to cleaner.config but it didn't seem to allow them.

It's good to know I'm not missing a much simpler solution.

Cheers and thanks,

-doug

From: Jeroen Reijn <[hidden email]>
Reply-To: Hippo CMS 7 development public mailinglist <[hidden email]>
Date: Thu, 2 Feb 2012 10:13:44 +0100
To: Hippo CMS 7 development public mailinglist <[hidden email]>
Subject: Re: [Hippo-cms7-user] Preserving Namespaces in the root HTML node of Editable Documents

Hi Douglas,

as far as I know it's not possible right now with the HTML cleaner. Are your legacy document put entirely into one single HTML field in Hippo? Most of the time the actual namespace is put in the actual html output that contains the dc namespace.

Could you perhaps describe your content model a bit more? Otherwise you might need to change the HTML cleaner, but I do not know if it has knowledge of namespaces right now.

Cheers,

Jeroen   

On Wed, Feb 1, 2012 at 7:31 PM, Douglas Hurbon <[hidden email]> wrote:
Hello all,

Maybe somebody has a way to accomplish this.  Our legacy content depends upon a set of custom namespaces in the root HTML node of our documents. 

For example:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" >


// rest of document


</html>


 I'd like to be able to preserve those namespaces in Hippo CMS 7.7.  I've tried modifying the cleaner.config, adding:

  • hippohtmlcleaner:attributes: xmlns
To the already existing:
  • hippohtmlcleaner:name: html

But after an edit in Xinha (which at least receives the namespaces with this.fullPage = true) the document looks like:

<html>

// rest of document

</html>

Is there some way to turn off the hippoHTMLcleaner completely?  Is it getting stripped in Xinha?

Thanks,

-doug

The City University of New York



_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html

_______________________________________________ Hippo-cms7-user mailing list and forums http://www.onehippo.org/cms7/support/forums.html

_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html