[opencms-dev] How to validate xml content?

Christian Steinert christian_steinert at web.de
Thu Aug 31 16:03:44 CEST 2006


> -----Ursprüngliche Nachricht-----
> Von: The OpenCms mailing list <opencms-dev at opencms.org>
> Gesendet: 31.08.06 15:20:31
> An: opencms-dev at opencms.org
> Betreff: [opencms-dev] How to validate xml content?

how to write jsp to validate xml content?
> due to modification on schema, I wanna search invalid xml content files.
> I tried validate(CmsObject cms) of CmsXmlContent.
> The returned CmsXmlContentErrorHandler's hasWarnings() and hasErrors()
> both return false on an invalid xml content. i dunno why.
> 
> any help?
> 
> Thank you very much.
> 
> Joe
> 

I don't know how these methods work or don't work. 

Do you want to validate some XHTML code to make sure that it is valid XML?
In that case the problem would be that all HTML stuff is encapsulated in <[CDATA[ - Blocks which are ignored by any xml parser and you would have to pull out the HTML content for these blocks and validate them with normal Java-XML-processing (which I don't know how to do at present but whitch should be easy to loop up).


hth somehow
christian
_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222




More information about the opencms-dev mailing list