Loading ...
Sorry, an error occurred while loading the content.

delaying xml parsing untill xsl arrives...A solution?

Expand Messages
  • Gabi Bucataru
    Hi, There is an interesting fenomen that occurs when I access an xml (plus xsl) file... The scenario: The user sends a request to the server where a servlet
    Message 1 of 3 , Nov 30, 2000
    • 0 Attachment
      Hi,

      There is an interesting fenomen that occurs when I access an xml (plus xsl)
      file...

      The scenario:
      The user sends a request to the server where a servlet pulls out the right
      data from the database and sends it back to the user as an xml that have a
      reference to a stylesheet. Take a look at
      http://www.pattersongray.com/webas^tkvbw (you'll probably get a blank page
      or some sort of an parser error). Remember, it works for me...

      The simptom:
      Now there are times when the xml comes in fine but sometimes I get a blank
      page or an parser error. Seems like the parser starts processing the xml
      file before the style sheet arrives.
      When I access the xml/xsl from our office , there are no problems at all.

      The discovery:
      I know this sounds weird to some of you, but I discovered this problem while
      building a html databind to a xml file. I had some combo boxes that used a
      vbscript to populate them with the data from the xml file. Same deal, worked
      fine in our office, but gave me an error when viewing it from the server
      (http://pattersongray.com/pga/demographics.htm). The error said:

      "the data necessary to complete this operation [the vb script for the combo
      boxes] is not YET available"

      I inserted the xml in the html (instead of having it referenced)
      and...surprise! -- It worked (http://pattersongray.com/pga/fusion.htm).
      Seems like the farther the user is from the server, the greater the error
      chance is...

      The QUESTION (finally):
      1. Is there a way of delaying the parsing of an xml file until the
      referenced stylesheet arrives to the user's machine? OR
      2. Can I insert the xsl in the xml?

      I appreciate your patience to read through and giving your oppinion.

      Regards,
      Gabi.


      [Non-text portions of this message have been removed]
    • dherzner@pequotcap.com
      gabi, are you setting the asynch property of the document object to false? ... (plus xsl) ... the right ... have a ... blank page ... a blank ... the xml ...
      Message 2 of 3 , Dec 1, 2000
      • 0 Attachment
        gabi, are you setting the asynch property of the document object to
        false?

        --- In xml-doc@egroups.com, "Gabi Bucataru" <gabi@p...> wrote:
        > Hi,
        >
        > There is an interesting fenomen that occurs when I access an xml
        (plus xsl)
        > file...
        >
        > The scenario:
        > The user sends a request to the server where a servlet pulls out
        the right
        > data from the database and sends it back to the user as an xml that
        have a
        > reference to a stylesheet. Take a look at
        > http://www.pattersongray.com/webas^tkvbw (you'll probably get a
        blank page
        > or some sort of an parser error). Remember, it works for me...
        >
        > The simptom:
        > Now there are times when the xml comes in fine but sometimes I get
        a blank
        > page or an parser error. Seems like the parser starts processing
        the xml
        > file before the style sheet arrives.
        > When I access the xml/xsl from our office , there are no problems
        at all.
        >
        > The discovery:
        > I know this sounds weird to some of you, but I discovered this
        problem while
        > building a html databind to a xml file. I had some combo boxes that
        used a
        > vbscript to populate them with the data from the xml file. Same
        deal, worked
        > fine in our office, but gave me an error when viewing it from the
        server
        > (http://pattersongray.com/pga/demographics.htm). The error said:
        >
        > "the data necessary to complete this operation [the vb script for
        the combo
        > boxes] is not YET available"
        >
        > I inserted the xml in the html (instead of having it referenced)
        > and...surprise! -- It worked
        (http://pattersongray.com/pga/fusion.htm).
        > Seems like the farther the user is from the server, the greater the
        error
        > chance is...
        >
        > The QUESTION (finally):
        > 1. Is there a way of delaying the parsing of an xml file until the
        > referenced stylesheet arrives to the user's machine? OR
        > 2. Can I insert the xsl in the xml?
        >
        > I appreciate your patience to read through and giving your oppinion.
        >
        > Regards,
        > Gabi.
        >
        >
        > [Non-text portions of this message have been removed]
      • Gabi Bucataru
        Yes, here is the code: // Load XML var xml = new ActiveXObject( Microsoft.XMLDOM )
        Message 3 of 3 , Dec 1, 2000
        • 0 Attachment
          Yes, here is the code:

          <html>
          <body>
          <script language="javascript" for="window" event="onload">
          // Load XML
          var xml = new ActiveXObject("Microsoft.XMLDOM")
          xml.async = false
          xml.load("report.xml")

          // Load the XSL
          var xsl = new ActiveXObject("Microsoft.XMLDOM")
          xsl.async = false
          xsl.load("report.xsl")

          // Transform
          document.write(xml.transformNode(xsl))
          </script>

          </body>
          </html>





          -----Original Message-----
          From: dherzner@... [mailto:dherzner@...]
          Sent: Friday, December 01, 2000 1:11 PM
          To: xml-doc@egroups.com
          Subject: [xml-doc] Re: delaying xml parsing untill xsl arrives...A
          solution?


          gabi, are you setting the asynch property of the document object to
          false?

          --- In xml-doc@egroups.com, "Gabi Bucataru" <gabi@p...> wrote:
          > Hi,
          >
          > There is an interesting fenomen that occurs when I access an xml
          (plus xsl)
          > file...
          >
          > The scenario:
          > The user sends a request to the server where a servlet pulls out
          the right
          > data from the database and sends it back to the user as an xml that
          have a
          > reference to a stylesheet. Take a look at
          > http://www.pattersongray.com/webas^tkvbw (you'll probably get a
          blank page
          > or some sort of an parser error). Remember, it works for me...
          >
          > The simptom:
          > Now there are times when the xml comes in fine but sometimes I get
          a blank
          > page or an parser error. Seems like the parser starts processing
          the xml
          > file before the style sheet arrives.
          > When I access the xml/xsl from our office , there are no problems
          at all.
          >
          > The discovery:
          > I know this sounds weird to some of you, but I discovered this
          problem while
          > building a html databind to a xml file. I had some combo boxes that
          used a
          > vbscript to populate them with the data from the xml file. Same
          deal, worked
          > fine in our office, but gave me an error when viewing it from the
          server
          > (http://pattersongray.com/pga/demographics.htm). The error said:
          >
          > "the data necessary to complete this operation [the vb script for
          the combo
          > boxes] is not YET available"
          >
          > I inserted the xml in the html (instead of having it referenced)
          > and...surprise! -- It worked
          (http://pattersongray.com/pga/fusion.htm).
          > Seems like the farther the user is from the server, the greater the
          error
          > chance is...
          >
          > The QUESTION (finally):
          > 1. Is there a way of delaying the parsing of an xml file until the
          > referenced stylesheet arrives to the user's machine? OR
          > 2. Can I insert the xsl in the xml?
          >
          > I appreciate your patience to read through and giving your oppinion.
          >
          > Regards,
          > Gabi.
          >
          >
          > [Non-text portions of this message have been removed]


          -------------------------------------------------------------------
          Post a message: mailto:xml-doc@egroups.com
          Unsubscribe: mailto:xml-doc-unsubscribe@egroups.com
          Switch to digest: mailto:xml-doc-digest@egroups.com
          Put mail on hold: mailto:xml-doc-nomail@egroups.com
          Contact adminstrator: mailto:xml-doc-owner@egroups.com
          Make changes via Web: http://www.egroups.com/subscribe/xml-doc/
          Read archived messages: http://www.egroups.com/messages/xml-doc/
          -------------------------------------------------------------------
        Your message has been successfully submitted and would be delivered to recipients shortly.