| Method from org.apache.cocoon.portal.transformation.RSSTransformer Detail: |
public void endElement(String uri,
String name,
String raw) throws SAXException {
if ("description".equals(name)) {
final String text = this.endTextRecording();
final String html = "< html >< body >"+text+"< /body >< /html >";
Object parsed = null;
XMLSerializer serializer = null;
try {
serializer = (XMLSerializer)this.manager.lookup(XMLSerializer.ROLE);
InputStream inputStream = new ByteArrayInputStream(html.getBytes());
this.xmlizer.toSAX(inputStream,
"text/html",
null,
serializer);
// if no exception occurs, everything is fine!
parsed = serializer.getSAXFragment();
} catch (Exception ignore) {
// just ignore all exceptions
} finally {
this.manager.release( serializer );
}
if ( parsed != null ) {
this.deserializer.setConsumer( this.filter );
this.deserializer.deserialize( parsed );
} else {
this.sendTextEvent(text);
}
}
super.endElement(uri,name,raw);
}
receive notification of end element event. |
public Serializable getKey() {
return "1";
}
|
public SourceValidity getValidity() {
return NOPValidity.SHARED_INSTANCE;
}
|
public void recycle() {
this.manager.release( this.xmlizer );
this.manager.release( this.deserializer );
this.xmlizer = null;
this.deserializer = null;
this.filter = null;
super.recycle();
}
|
public void setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par) throws IOException, SAXException, ProcessingException {
super.setup(resolver, objectModel, src, par);
try {
this.xmlizer = (XMLizer)this.manager.lookup(XMLizer.ROLE);
this.deserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
} catch (ServiceException ce) {
throw new ProcessingException("Unable to lookup component.", ce);
}
}
|
public void setupTransforming() throws IOException, SAXException, ProcessingException {
super.setupTransforming();
this.filter = new HTMLFilter( this.xmlConsumer );
}
|
public void startElement(String uri,
String name,
String raw,
Attributes attributes) throws SAXException {
super.startElement(uri,name,raw,attributes);
if ("description".equals(name)) {
this.startTextRecording();
}
}
receive notification of start element event. |