You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2004/06/03 15:00:04 UTC

[WIKI-UPDATE] HansEilers XML XMLProcessingHowTo Thu Jun 3 15:00:04 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=HansEilers , version: 1 on Wed Jun  3 13:21:54 2004 by HansEilers

New page created:
+ Starting Cocoon developer. Building a CMS based on Cocoon.
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=XML , version: 4 on Wed Jun  3 12:11:17 2004 by JoergHeinicke

- 
- == travel of china==
- 
- [http-link-to-www.scbiztrip.com/] [http-link-to-www.jiuzhaigou-china.com/] 
- [http-link-to-www.yzcruises.com/] [http-link-to-www.sc-meeting.com/]
- 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=XMLProcessingHowTo , version: 7 on Wed Jun  3 12:58:16 2004 by TimLarson

+ {{{
+   import org.apache.excalibur.xml.dom.DOMParser;
+   import org.w3c.dom.Document;
+   import org.xml.sax.InputSource;
+ 
+     ServiceManager manager;
+    (obtained via Serviceable or something)
+ 
+     public Document stringToDOM(String input) throws Exception {
+         Document result = null;
+         DOMParser parser = null;
+         try {
+             parser = (DOMParser)manager.lookup(DOMParser.ROLE);
+             result = parser.parseDocument(new InputSource(new StringReader(input)));
+         } finally {
+             manager.release(parser);
+         }
+         return result;
+     }
+ }}}
-   function serializeNode(node) {                                                                                            
+   function serializeNode(node) {
-       return Packages.org.apache.cocoon.xml.XMLUtils.serializeNodeToXML(node);                                              
?                                                                               ----------------------------------------------

+       return Packages.org.apache.cocoon.xml.XMLUtils.serializeNodeToXML(node);
-   }                                                                                                                         
+   }