473,385 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML generation

The XML DOM implementation extends the XML document object with an
"XML" property to retrieve the textual form of the document. This
causes my javascript code not to work with Firefox, because the XML
DOM standard doesn't have that property. But how else can I get the
XML doc's text?
Jun 27 '08 #1
6 1646
Peter Laman wrote:
The XML DOM implementation extends the XML document object with an
"XML" property to retrieve the textual form of the document. This
causes my javascript code not to work with Firefox, because the XML
DOM standard doesn't have that property. But how else can I get the
XML doc's text?
I am not sure I understand what you are asking about. If you use the
xmlNode.xml property with MSXML in IE then the equivalent with Mozilla is
new XMLSerializer().serializeToString(xmlNode)

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jun 27 '08 #2
Peter Laman wrote:
But how else can I get the XML doc's text?
Why do you think you need the document's text representation? Why can't
you retrieve the information you need from the DOM?
Jun 27 '08 #3
I should say that, if you do need to generate XML source (probably not
true in browser code, but may be true in the server or standalone apps):
DOM Level 3 and later has an optional load/save module. If you don't
have that available you may be able to put the DOM through an XSLT
stylesheet or JAXP serializer. Check the documentation for your
environment to see what's available, or load up one of the available
libraries.

But the right place to begin is with the problem you're trying to solve.
If you're working with a DOM in a brower, it would be somewhat unusual
for you to need to see the XML via anything but the browser's "view
source" or by looking at the source file some other way... except
possibly as a debugging aid.
Jun 27 '08 #4
On May 5, 9:38 pm, "Joseph J. Kesselman" <keshlam-nos...@comcast.net>
wrote:
I should say that, if you do need to generate XML source (probably not
true in browser code, but may be true in the server or standalone apps):
DOM Level 3 and later has an optional load/save module. If you don't
have that available you may be able to put the DOM through an XSLT
stylesheet or JAXP serializer. Check the documentation for your
environment to see what's available, or load up one of the available
libraries.

But the right place to begin is with the problem you're trying to solve.
If you're working with a DOM in a brower, it would be somewhat unusual
for you to need to see the XML via anything but the browser's "view
source" or by looking at the source file some other way... except
possibly as a debugging aid.
What I'm trying to do is to have the user edit a table's content which
comes from the server in XML format. The scripts parses the XML string
into DOM and manipulates the DOM as the user edits its content. The
aim is to minimize interaction with the server. So all the editing is
done locally using JavaScript. If the user confirms the edits made, I
want to post the changed XML code to the server and for that I want to
generate the XML text from the DOM document.
Jun 27 '08 #5
On May 5, 5:20 pm, Martin Honnen <mahotr...@yahoo.dewrote:
Peter Laman wrote:
The XML DOM implementation extends the XML document object with an
"XML" property to retrieve the textual form of the document. This
causes my javascript code not to work with Firefox, because the XML
DOM standard doesn't have that property. But how else can I get the
XML doc's text?

I am not sure I understand what you are asking about. If you use the
xmlNode.xml property with MSXML in IE then the equivalent with Mozilla is
new XMLSerializer().serializeToString(xmlNode)

--

Martin Honnen
http://JavaScript.FAQTs.com/
Thanks Martin, that does the trick!
Jun 27 '08 #6
Ah. OK, that's reasonable.
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
8
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested...
0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
8
by: | last post by:
Wel, I am rebuilding the VC# 2002 project that I have deployment problems with the 2003 version, hoping this solves the problems, but now I encounter this wierd bug??? If I have the project, and...
9
by: Hayato Iriumi | last post by:
Hello, I hear some hypes about creating code to generate C# or VB .NET code, that is, code generation (sounds straight forward enough). I haven't really seen how it's done in real world. I'm...
1
by: George Meng | last post by:
I want to evaluate some code generation tool for my company. Want to get some idea from you. The bottom line is I want to get a tool to generate both store procedure as well as business object...
3
by: Eddy Ilg | last post by:
Hi, I would like to suppress .pyc generation or have the .pyc generation in a speical seperate root (I found something about PYCROOT). Has this been implemented yet? Is there an environment...
31
by: eliben | last post by:
Hello, In a Python program I'm writing I need to dynamically generate functions and store them in a dict. eval() can't work for me because a function definition is a statement and not an...
4
by: Troels Arvin | last post by:
Hello, We have started planning our DB2 generation 8 -9.1/9.5 upgrades, as April 30 2009 is no longer distant future (ordinary support for DB2 generation 8 on Linux/Unix/Windows==LUW will end on...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.