{
// The tags we care about are "ttl" and "item", nothing else.
if (localName.equals("link"))
{
// "link" tag
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
else if (localName.equals("guid"))
{
// "guid" tag
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
else if (localName.equals("pubDate"))
{
// "pubDate" tag
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
else if (localName.equals("title"))
{
// "title" tag
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
else if (localName.equals("category"))
{
// "category" tag
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
else
{
// Handle potentially longer fields. Both "description" and "content" fields can potentially be large; they are thus
// processed as temporary files. But the dance is complicated because (a) we only want one PRIMARY content source,
// and (b) we want access to the description field, if it is not used as primary content.
switch (dechromedContentMode)
{
case DECHROMED_NONE:
if (localName.equals("description"))
{
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
break;
case DECHROMED_DESCRIPTION:
if (localName.equals("description"))
{
try
{
File tempFile = File.createTempFile("_rssdata_","tmp");
return new XMLFileContext(theStream,namespaceURI,localName,qName,atts,tempFile);
}
catch (java.net.SocketTimeoutException e)
{
throw new ManifoldCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED);
}
catch (IOException e)
{
throw new ManifoldCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
break;
case DECHROMED_CONTENT:
if (localName.equals("content"))
{
try
{
File tempFile = File.createTempFile("_rssdata_","tmp");
return new XMLFileContext(theStream,namespaceURI,localName,qName,atts,tempFile);
}
catch (java.net.SocketTimeoutException e)
{
throw new ManifoldCFException("IO exception creating temp file: "+e.getMessage(),e);
}
catch (InterruptedIOException e)
{
throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED);
}
catch (IOException e)
{
throw new ManifoldCFException("IO exception creating temp file: "+e.getMessage(),e);
}
}
else if (localName.equals("description"))
{
return new XMLStringContext(theStream,namespaceURI,localName,qName,atts);
}
break;
default:
break;
}