vgritsenko 2002/10/22 21:17:56 Modified: src/java/org/apache/cocoon/xml XMLUtils.java Log: Rework transformer to use xsp:expr. So now it's not about only DOM anymore... Revision Changes Path 1.10 +11 -8 xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java Index: XMLUtils.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- XMLUtils.java 7 Aug 2002 13:15:01 -0000 1.9 +++ XMLUtils.java 23 Oct 2002 04:17:56 -0000 1.10 @@ -261,7 +261,7 @@ * @param contentHandler the SAX content handler * @param text the value */ - public static void valueOf(ContentHandler contentHandler, String text) + public static void valueOf(ContentHandler contentHandler, String text) throws SAXException { if (text != null) { data(contentHandler, text); @@ -275,10 +275,10 @@ * @param contentHandler the SAX content handler * @param v the XML fragment */ - public static void valueOf(ContentHandler contentHandler, XMLizable v) + public static void valueOf(ContentHandler contentHandler, XMLizable v) throws SAXException { if (v != null) { - try { + try { v.toSAX(contentHandler); } catch(ProcessingException e) { throw new SAXException(e); @@ -293,10 +293,13 @@ * @param contentHandler the SAX content handler * @param v the value */ - public static void valueOf(ContentHandler contentHandler, Node v) + public static void valueOf(ContentHandler contentHandler, Node v) throws SAXException { if (v != null) { DOMStreamer streamer = new DOMStreamer(contentHandler); + if (contentHandler instanceof LexicalHandler) { + streamer.setLexicalHandler((LexicalHandler)contentHandler); + } streamer.stream(v); } } @@ -309,8 +312,8 @@ * @param contentHandler the SAX content handler * @param v the XML fragment */ - public static void valueOf(ContentHandler contentHandler, - Collection v) + public static void valueOf(ContentHandler contentHandler, + Collection v) throws SAXException { if (v != null) { Iterator iterator = v.iterator(); @@ -331,7 +334,7 @@ * @param contentHandler the SAX content handler * @param v the value */ - public static void valueOf(ContentHandler contentHandler, Object v) + public static void valueOf(ContentHandler contentHandler, Object v) throws SAXException { if (v == null) { return;
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]