Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

File creation problems

Community Beginner ,
Jul 22, 2007 Jul 22, 2007
Hi,
I'm pretty new at writing extensions so I'm quite certain my problem is a mistake on my part.
I've written a piece of code that takes a data file and formats it into a table and writes the table to a new file (the client doesn't want to use templates, that's why it's done this way).
The data file is formatted with the first line as the page title, the second line has the column names and the rest is the data. The data if formatted with ";"
The function doStuff calls the fixTag function.

Whenever I run this, the contents of the data file (opened with fh = dreamweaver.openDocument(theFile); in the fixTag function) receives the data I try to write to the new file (created with var newTableDoc = dreamweaver.createXHTMLDocument(); in the doStuff function).

What am I doing wrong here. I've tried using dreamweaver.releaseDocument to release the data file, but it doesn't help. I've tried creating the new file with dreamweaver.getNewDocumentDOM but can't figure out how to then save that without running into the same overwrite problem.
Any help, tips, and the like is greatly appreciated.

Problem code is attached.
TOPICS
Extensions
266
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 23, 2007 Jul 23, 2007
Found the solution. Was my poor coding.
I just need to have

dreamweaver.createXHTMLDocument();
newTableDoc=dreamweaver.getActiveWindow();
newTableDoc.getElementsByTagName("body")[0].innerHTML = rString;

hope this helps someone else.

Cheers.
Translate
Community Beginner ,
Jul 22, 2007 Jul 22, 2007
Almost forgot some important details.
Dreamweaver MX 2004 running on win 2k system.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 23, 2007 Jul 23, 2007
LATEST
Found the solution. Was my poor coding.
I just need to have

dreamweaver.createXHTMLDocument();
newTableDoc=dreamweaver.getActiveWindow();
newTableDoc.getElementsByTagName("body")[0].innerHTML = rString;

hope this helps someone else.

Cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines