Trouble with API_AddReplaceDBPage bracket closure

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have an xml page I need to edit and update. I seem to be running into an error when doing so because bracket closures.
https://my.quickbase.com/api-guide/add_replace_dbpage.html
The Example Post has this:

         <qdbapi>

<pagename>newstylesheet.xsl</pagename>

<pagetype>1</pagetype>

<![CDATA[<pagebody>

<?xml version='1.0'?>

http://www.w3.org/1999/XSL/Transform" version="1.0">

 <xsl:template match="/">

   <html>

    <head>

    </head>

    <body>

      Hello World

    </body>

   </html>

 </xsl:template>

</xsl:stylesheet>

]]></pagebody>

<ticket>auth_ticket</ticket>

<apptoken>app_token</apptoken> 

</qdbapi>

The issue at this point is that "<![CDATA[<pagebody>" starts with pagebody inside both brackets but ends "]]></pagebody>" outside.

what is the correct format this needs to be in for this to post? I keep getting "unable to parse xml"

Photo of Robert

Robert

  • 30 Points

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,894 Points 20k badge 2x thumb
Move the opening CDATA SGML element after the <pagebody> XML tag

http://pastebin.com/98dt7PpH


The purpose of the CDATA section is to prevent the text within it from being parsed as XML data.

On other matters I don't know why you are using XML and XSLT as it has become quite unpopular over time:

Gogle Trends XML sand XSLT

https://www.google.com/trends/explore?date=all&q=xml


https://www.google.com/trends/explore?date=all&q=xslt
Photo of Robert

Robert

  • 30 Points
Thank you. it was frustrating getting to this point in the problem late last night only for the example quickbase gave to be wrong. The reason I am using xml is because I have not learned xlst, Recently learned ajax and jquery so now I am learning about parse xml data from a doquery into something usable.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,894 Points 20k badge 2x thumb
Are you using the QuickBase API from JavaScript in a browser or are you calling the API from a server-side language?
Photo of Robert

Robert

  • 30 Points
this is a landing page of an application showing a quickbase html. I used api doquery and using an old file attachment script you made for parsing the xml response, that will now update the xml that the html calendar on the front page calls. I plan on eventually replacing the calendar with my own removing the xml. But for now it works.