AW: [Project_owners] Pretty print an XML string

Thomas Reitmayr treitmayr at yahoo.com
Wed Apr 19 16:59:09 EDT 2006


Hi,
XML in this case is a data type, just try this
  alert(XML("<test><ex>abc</ex></test>").toXMLString());
or just
  alert(<test><ex>abc</ex></test>.toXMLString());
 which should give you the pretty-printed xml.
-Thomas

PS: http://www.ecma-international.org/publications/standards/Ecma-357.htm shows where it's heading

----- Ursprüngliche Mail ----
Von: Jon Stritar <jstritar at MIT.EDU>
An: Mozdev Project Owners List <project_owners at mozdev.org>
Gesendet: Mittwoch, den 19. April 2006, 23:15:00 Uhr
Betreff: Re: [Project_owners] Pretty print an XML string

Do you know how to access the XML function from an XPCOM context?
Firefox just reports the following error:

Error: xml is a reserved identifier

Jon

On Wed, 2006-04-19 at 22:16 +0200, Brian King wrote:
> Alex Vincent wrote:
> > You've gotten my attention.  DevMo is rather sparse on examples of the
> > XML object, and I'm not able to make what you describe work from the
> > URL bar with XML or XUL documents:
> > 
> > javascript:alert(XML(document).toXMLString())
> 
> What type is the document parameter in this example? It has to be a string.
> 

_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners





More information about the Project_owners mailing list