Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 80145 invoked from network); 11 Dec 2008 15:45:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2008 15:45:32 -0000 Received: (qmail 62951 invoked by uid 500); 11 Dec 2008 15:45:42 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 62761 invoked by uid 500); 11 Dec 2008 15:45:40 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 62734 invoked by uid 99); 11 Dec 2008 15:45:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 07:45:40 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 15:45:25 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5F9AB234C37C for ; Thu, 11 Dec 2008 07:45:05 -0800 (PST) Message-ID: <1490991115.1229010305389.JavaMail.jira@brutus> Date: Thu, 11 Dec 2008 07:45:05 -0800 (PST) From: "Jonathan Anstey (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1184) Add a new Dataformat - tidyMarkup - which allows us to unmarshal bad HTML to good (XML) Html. In-Reply-To: <1151556144.1229002985469.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48111#action_48111 ] Jonathan Anstey commented on CAMEL-1184: ---------------------------------------- I've committed your patch in rev 725715. Thanks again! Some minor changes I made: - Checkstyle errors - Added dataformat to UnmarshalType + test case for this (TidyMarkupDataFormatWithUnmarshalTypeTest.java) - Added OSGi exports - Removed runtime dependency on camel-spring - you only need camel-core - Added log4j config file - Change to TidyMarkupDataFormat.java {code} public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception { if (dataObjectType.isAssignableFrom(String.class)) { return asStringTidyMarkup(inputStream); } else if (dataObjectType.isAssignableFrom(Node.class)) { - return asStringTidyMarkup(inputStream); + return asNodeTidyMarkup(inputStream); } else { throw new CamelException("The return type [" + dataObjectType.getCanonicalName() + "] is unsupported"); } } {code} > Add a new Dataformat - tidyMarkup - which allows us to unmarshal bad HTML to good (XML) Html. > --------------------------------------------------------------------------------------------- > > Key: CAMEL-1184 > URL: https://issues.apache.org/activemq/browse/CAMEL-1184 > Project: Apache Camel > Issue Type: New Feature > Reporter: Ramon Buckland > Assignee: Ramon Buckland > Priority: Minor > Fix For: 1.5.1, 2.0.0 > > Attachments: tidyMarkup-sourcefiles.tgz > > Original Estimate: 4 hours > Remaining Estimate: 4 hours > > Using TagSoup, a competent 'bad html' to good well formed (xml) Html, we can create a new dataformat such that .. > from("direct:fromSomeHttpSite") > .unmarshal().tidyMarkup() > .setBody().xpath("//table/tr/td[1]") > .to("direct:foo") > we get to turn the nasty HTML into goody HTML which can go through XSLT components and be xpathed and all the goodness we love. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.