You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jani Kaarnalehto <ka...@majorus.fi> on 2003/02/06 11:55:03 UTC

Parsing XML from text

Hey all,

I'm developing a content management system with cocoon and torque. (I will 
make it public as open source, when I get version 0.0 ready.) 

I have a problem with parsing text from database in to a XML-document.

My app stores (X)HTML as XML into a relational database. I store only 
elements not full XML-documents. Here is an example:

----

<document-body>
   <content>
      <h1>Sample page</h1>
      <p>This is text with an entity: &nbsp;</p>
   </content>
</document-body>

----

I'm using dom4j for handling XML inside my app.

I use DocumentHelper.parseText()-method for creating XML-document. But
like in the example there might be entities in the text (&nbsp; &auml;
etc.) The result is an exception complaining about missing entity
declarations.

It seems that dom4j isn't suitable for my needs after all and noe I'm 
seeking alternatives.

Is there an api for doing this build inside Cocoon? 
Any other suggestions?

Thanks for reading this far...

-Jani



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>