cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] XML XMLProcessingHowTo Thu Jun 3 14:00:03 2004
Date Thu, 03 Jun 2004 12:00:03 GMT
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);
-   }                                                                                    
                                    
+   }



Mime
View raw message