Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Displaying xml data

    I'm trying to find an element which can display xml data properly. Any suggestions?

    #2
    For a simple non-interactive read-only display, consider just quoting it and displaying it in an HTMLFlow. This is easy to copy and paste, if that's needed.

    You can also use an HTMLFlow in contentsType:"page" mode to get the browser's default rendering of the XML (generally a collapsible tree).

    Finally there's the DOMGrid, also an interactive collapsible tree. Bear in mind, although it's based on TreeGrid, it hasn't been designed with a huge degree of customizability. But if you like the default behavior, it's a good approach.

    Comment


      #3
      I tried using the HTMLFlow approach but it just shows up as regular string. Am I missing something?

      Code:
      isc.HTMLFlow.create({
          width:230,height: 200,
          contentsType: "page",
          contents:"<?xml version="1.0" encoding="ISO-8859-1"?><ntOrder><orderInstance><cwDocId>13156001</cwDocId><orderInstance></ntOrder>"
      })

      Comment


        #4
        Yes, you need to quote it or it's going to be interpreted as HTML tags.

        Comment


          #5
          I have quotes around the content. I need more?

          Comment


            #6
            You need eg <someTag> to be &lt;someTag&gt;

            Comment


              #7
              That's exactly what I have...

              The original data was

              Code:
              <ntOrder><orderInstance><cwDocId>13156001</cwDocId></orderInstance></ntOrder>
              now it's

              Code:
              "&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;&lt;ntOrder&gt;&lt;orderInstance&gt;&lt;cwDocId&gt;13156001&lt;/cwDocId&gt;&lt;orderInstance&gt;&lt;/ntOrder&gt;"

              Comment


                #8
                By regular string, I mean that it's not showing as "the browser's default rendering of the XML (generally a collapsible tree)."

                Comment


                  #9
                  By setting contentsType:"page" you are asking for an <iframe> to be created and to load content from a separate URL, not your contents.

                  Comment

                  Working...
                  X