Created
November 26, 2010 05:30
-
-
Save shenie/716310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String convertToString(GPathResult doc) { | |
def defaultNamespace = doc.lookupNamespace('') | |
if (defaultNamespace) { | |
def docWithNamespace = { | |
mkp.declareNamespace("": defaultNamespace) | |
out << doc | |
} | |
return new StreamingMarkupBuilder().bind(docWithNamespace) | |
} else { | |
return XmlUtil.serialize(doc as GPathResult) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment