Revision 55926
Added by Alessia Bardi almost 5 years ago
ApplyXslt.java | ||
---|---|---|
7 | 7 |
import javax.xml.transform.stream.StreamSource; |
8 | 8 |
|
9 | 9 |
import org.springframework.core.io.Resource; |
10 |
import org.springframework.util.StringUtils; |
|
10 | 11 |
|
11 | 12 |
/** |
12 | 13 |
* Applies a stylesheet to a XML string and returns an XML string. |
... | ... | |
50 | 51 |
|
51 | 52 |
@Override |
52 | 53 |
public Source toStream(String input) { |
54 |
if(StringUtils.isEmpty(input)) input = null; |
|
53 | 55 |
return new StreamSource(new StringReader(input)); |
54 | 56 |
} |
55 | 57 |
|
Also available in: Unified diff
Exception if input string is empty