We help IT Professionals succeed at work.

ASP XMLDOM

bLUE
bLUE asked
on
A problem with DOM

The XML file:

  <?xml version="1.0" ?>
- <LSSC>
- <ARTICLE>
  <TITLE>This is the Title</TITLE>
  <DATE>Monday, October 15, 2001</DATE>
  <AUTHOR>This is the Author</AUTHOR>
  <ARTICLE_TEXT>This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text. This is the article text.</ARTICLE_TEXT>
  <POSTED_BY />
  <DOC_LINK />
  </ARTICLE>
  </LSSC>



The ASP code:


note :
strText = "udfgludfgdufghufg"
     strPath = "G:\wwwroot\skillscentre\XML\Upload_ASP\XMLArticles\Article1510200122854.xml"

<%
dim strText , strPath
strText = Request.Form ("Text")
strPath = Request.Form ("path")
'************XMLDOM*******************************
'         Create an instance of the XML parser and load
Set source = Server.CreateObject("Microsoft.XMLDOM")
   source.async = false
'    load the article file
source.load strPath
'set root of document  
Set rootElement = source.documentElement
'**************Assign the article node a variable
dim aNode,newtext
Set aNode = source.documentElement.selectSingleNode("ARTICLE/ARTICLE_TEXT")


'**************Update the node with the text
newtext = strText
aNode.nodeTypedValue = newtext
'***************save
source.save(strPath)
response.write source.documentElement.selectSingleNode("ARTICLE/ARTICLE_TEXT")
Set source = Nothing
set aNode = Nothing
set newtext = nothing
%>

The error:

msxml3.dll error '8007007b'

The filename, directory name, or volume label syntax is incorrect.

/skillscentre/edit/editconfirm.asp, line 52

line 52 refers to:
source.save(strPath)

Other information:
User has full control to the XML path, i.e can write/read/delete the XML file.

Any help will be greatly appreicated. Thanks.
Comment
Watch Question

Michel SakrRounded IT Consultant / Projects manager / Cloud Consultant / IT Planning
CERTIFIED EXPERT

Commented:
check if the iusr_webservername have enough permissions to the files..
CERTIFIED EXPERT

Commented:
Hm... don't think that it makes a difference here, but that should be either:
source.save strPath
or
Call source.save(strPath)

...and check the path again. (Haven't we all looked straight at a bug and saying "This is correct. This IS correct. This is CORRECT. THIS IS CORR... wait... what's this?")

Author

Commented:
Hmm.. Nop that didnt work.
Users have permissions to create and write XML's..
Plus all the users have full control for this testing purpose. The path is correct..

any other ideas?
Wrong here .
strPath = "G:\wwwroot\skillscentre\XML\Upload_ASP\XMLArticles\Article1510200122854.xml"

What is G: ? Its just a mapping. When you run your pages, it doesn't understand G. You have to provide UNC path name. Like

\\computer_name\share_name\foldername

You may want to paly around with Mappath also

Author

Commented:
Server.mappath worked fine.
Then why 'B' ? If it does not satisfy you, you could ask me. But a 'B' grade is insult to me for a free service. Please try to encourage people for a FREE SERVICE

Rgds