Tuesday 15 January 2013

xml - How to convert a Document-Fragment to string content in JavaScript? -


I am converting XSLT into Safari Browser using Javascript.

The final output of my conversion is a document-piece object whose content is below

    

Actually its converted XML output. I need to use it as a string in my javascript code.

I am unable to do this .to string () or whatever can anyone help me here?

Thanks

Try XMLSerializer :

  var xmlAsDocument = ... // Your XSLT result var xmlAsString = new XMLSerializer (). SerializeToString (xmlAsDocument);    

No comments:

Post a Comment