Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2003, 02:12 PM
Authorized User
 
Join Date: Nov 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default xml add to databse problem

i have code that adds a xml data to a database

the structure of the xml document is as follows

<tutorial>
  <album>
       <title>adobe golive</title>
       <genre> web design </genre>
       <link>
      <title>http://hotwired.lycos.com/webmonkey/99/19/index3a.html? tw=authoring
      </title>
      </link>
  </album>
</tutorial>


-------------------------------------------------------------------
the code that adds the data is

Set objRecord = objDom.createElement("album") **********creates the album record
objRoot.appendChild objRecord

Set objFieldValue = objDom.createElement("title") **********creates software package title
objFieldValue.Text = Request.Form("titleQuery")

objRecord.appendChild objFieldValue

Set objFieldValue = objDom.createElement("genre") ******creates the genre of the package
objFieldValue.Text = Request.Form("genreQuery")



Set objFieldValue = objDom.createElement("link") *****creates the link
objFieldValue.Text = Request.Form("linkQuery")

objRecord.appendChild objFieldValue


------------------------------------------------------
but the structure of the add xml record after runnging the code is

<album>
<title>css</title>
<genre>authoring</genre>
</album>
<link>
<title>http://www.w3.org</title>
</link>


as you can see the album tag is closed before the link tag is starts, so i want the close album tag </album> to appear ater the </link> tag to keep the original structure of the xml document, so my xsl stylesheet works

any ideas??


thanks








 
Old December 12th, 2003, 06:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I don't think you've shown us the crucial bit of code. With your required structure, you need to
1. create the link element
2. create the title element and set its text
3. append the title element as a child of the link
4. append the link as a child of the album





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create XML file - According to the Value, add elem remya1000 General .NET 0 October 2nd, 2007 11:03 PM
Backup generation of SQL Server Databse using XML siddharth28 ASP.NET 1.0 and 1.1 Professional 3 June 12th, 2007 07:17 AM
javascript - add element to existing xml? willgotoo XML 4 October 8th, 2004 09:33 AM
how to add or delete a node from an xml documnet sai XML 1 March 22nd, 2004 06:54 AM
Add and Remove Nodes in XML document. tutul128 XML 3 March 1st, 2004 10:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.