Documentbuilder parse string not file
I guess this turns out to be another duplicate of the same things I read a lot about why the document's output is null when it is working correctly I apologize for wasting your time.
I am using Mule ESB, inside a groovy script I am calling this java and returning the xml document to the flow. My real problem is the flow not reading the xml document. I am very new to mule and have not done much with xml in Java. Looks to me like a meta. I marked your answer correct, but This should be closed. Thank you — Aheinlein. Show 1 more comment. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.
The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.
Accept all cookies Customize settings. Is there a short-cut I'm missing? Can I get transform to take my xml-string directly as a Source? Steve McRoberts. Optional 'thank-you' note:. I'm trying to do a server-side xsl transform of an xml string. But, no matter what I try, I can't get the xml string into a Document. I don't get an error, but the Document is always empty; somehow the parse is not taking the String. Here is the pertinent code: import java.
StringReader; import java. StringWriter; import javax. DocumentBuilder; import javax. DocumentBuilderFactory; import javax. Source; import javax.
Transformer; import javax. TransformerFactory; import javax. DOMSource; import javax. StreamResult; import javax. StreamSource; import org.
What irks me is that at one point I did have the magical combination that made this work, but I lost the code. Can someone help me with this, or show me a better way? Module java. Package javax. Object javax. Using this class, an application programmer can obtain a Document from XML. Obtain an instance of a DOMImplementation object. Specify the ErrorHandler to be used by the parser.
0コメント