How to get the full content of an XML file as a String using xmlStreamReader?
问题 I'm in a part of an application where I have an access to the xmlStreamReader which is representing the XML file needed to be fully read into a String . Is there a way to obtain the XML content without building another xmlStreamReader or using another stream on the file? 回答1: import javax.xml.stream.XMLStreamReader; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform