Help with XML + ASP

Discussion in 'XML' started by scottc, Feb 19, 2005.

  1. scottc

    scottc Guest

    I'm painfully new to XML, so please bare with me. I'm trying to create
    an xml document that contains multiple layers. For example,

    <root>
    <level1>
    <name></name>
    <id></id>
    <primary>
    <name></name>
    <id></id>
    </primary>
    </level1>
    </root>


    Initially, I tried to create the xml document and load it, but it
    doesn't work. This seems like it would be easier than trying to create
    the xml document in code.

    I'm creating my xml object in the global.asa file as follows:

    <object runat="server" scope="session" id="XMLObject"
    progid="Microsoft.XMLDOM"></object>

    This works and allows me to create the xml document within the code.
    But, if I try to load the xml document into this object it fails:

    xmlobject.load("mydoc.xml")

    I have the mydoc.xml document in the same location as the asp file that
    I'm running (i.e. wwwroot).

    I'm pretty lost and any suggestion would be greatly appreciated.

    Thanks,

    Scott.........
     
    scottc, Feb 19, 2005
    #1
    1. Advertising

  2. scottc wrote:


    > Initially, I tried to create the xml document and load it, but it
    > doesn't work. This seems like it would be easier than trying to create
    > the xml document in code.
    >
    > I'm creating my xml object in the global.asa file as follows:
    >
    > <object runat="server" scope="session" id="XMLObject"
    > progid="Microsoft.XMLDOM"></object>


    I don't think Microsoft.XMLDOM is suitable as a Session object. I think
    you will get more experience in an ASP and/or XML group on the Microsoft
    news server news.microsoft.com than in comp.text.xml.

    > This works and allows me to create the xml document within the code.
    > But, if I try to load the xml document into this object it fails:
    >
    > xmlobject.load("mydoc.xml")


    What exactly happens, what error messages do you get when you say it fails?
    The load method has a return value, the xmlobject has a parseError
    property, have you checked them for details?


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Feb 19, 2005
    #2
    1. Advertising

  3. scottc

    Andy Dingley Guest

    On 18 Feb 2005 17:16:31 -0800, "scottc"
    <> wrote:

    >I'm pretty lost and any suggestion would be greatly appreciated.


    MSXML ships with a good help file - take a read. There's a useful
    reference to all the DOM properties and methods, and there's also a
    few simple bits of example code.

    Server.MapPath() is useful too.

    I wouldn't begin by creating a DOM in global.asa either. Create your
    DOM on the page, as simple inline JScript code. Then (and only if you
    need to) there are some techniques you might use for caching this
    between pages.
     
    Andy Dingley, Feb 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bomb Diggy
    Replies:
    0
    Views:
    470
    Bomb Diggy
    Jul 28, 2004
  2. Tony Prichard
    Replies:
    0
    Views:
    791
    Tony Prichard
    Dec 12, 2003
  3. Mark Van Orman

    embedding xml in xml as non-xml :)

    Mark Van Orman, Sep 14, 2004, in forum: XML
    Replies:
    5
    Views:
    510
    Patrick TJ McPhee
    Sep 15, 2004
  4. Matt
    Replies:
    3
    Views:
    370
    Bob Barrows [MVP]
    Apr 23, 2004
  5. Erik Wasser
    Replies:
    5
    Views:
    527
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page