The markup in the document following the root element must be well-formed.

weissm's Avatar

weissm

14 Jul, 2011 05:47 PM

I'm using web services and ASP.net to update a page. The call is successful, but when I try to preview the page in cascade I get this:
`An error occurred: The markup in the document following the root element must be well-formed.: The markup in the document following the root element must be well-formed.

You may choose to retry the operation. If the problem persists, please contact a system administrator.

The error has been logged to the system console.`

When pushing this XHTML it works:
@"<table border=""0"" cellspacing=""0"" cellpadding=""2"" width=""100%""> <tbody> <tr> <td valign=""top"" width=""33%""><strong>Florida Campus</strong><br /> 2600 North Military Trail<br /> West Palm Beach, FL 33409-2911<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Michigan Campus</strong><br /> 4000 Whiting Dr<br /> Midland, MI 48640<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Texas Campus</strong><br /> 1114 W Fm 1382<br /> Cedar Hill, TX 75104-1204<br /> 1.800.622.9000</td> </tr> </tbody></table>"

This also works:
@"<h3>Florida Campus</h3>

But fails when I push this:
@"<table border=""0"" cellspacing=""0"" cellpadding=""2"" width=""100%""> <tbody> <tr> <td valign=""top"" width=""33%""><strong>Florida Campus</strong><br /> 2600 North Military Trail<br /> West Palm Beach, FL 33409-2911<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Michigan Campus</strong><br /> 4000 Whiting Dr<br /> Midland, MI 48640<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Texas Campus</strong><br /> 1114 W Fm 1382<br /> Cedar Hill, TX 75104-1204<br /> 1.800.622.9000</td> </tr> </tbody></table><h3>Florida Campus</h3>"

This also fails:
@"<h3>Florida Campus</h3><table border=""0"" cellspacing=""0"" cellpadding=""2"" width=""100%""> <tbody> <tr> <td valign=""top"" width=""33%""><strong>Florida Campus</strong><br /> 2600 North Military Trail<br /> West Palm Beach, FL 33409-2911<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Michigan Campus</strong><br /> 4000 Whiting Dr<br /> Midland, MI 48640<br /> 1.800.622.9000</td> <td valign=""top"" width=""33%""><strong>Texas Campus</strong><br /> 1114 W Fm 1382<br /> Cedar Hill, TX 75104-1204<br /> 1.800.622.9000</td> </tr> </tbody></table>"

  1. Support Staff 1 Posted by Tim on 14 Jul, 2011 07:08 PM

    Tim's Avatar

    Hi Mike,

    It looks like you are attempting to provide some invalid XML. Try pasting those code snippets into an XML validator like the one here. It should give you an idea of where the problems lie. One thing I noticed right off the bat is that all of the attributes have two sets of quotes around them. This could be part of the problem.

    Let me know what you find.

    Thanks

  2. 2 Posted by weissm on 14 Jul, 2011 07:15 PM

    weissm's Avatar

    The double quotes are literal string escapes in C#.

    The XHTML is valid according to W3, and has been run through HTML Tidy.

  3. Support Staff 3 Posted by Tim on 14 Jul, 2011 07:19 PM

    Tim's Avatar

    If you're using any sort of server-side scripting within Cascade, you'll want to surround it with Passthrough Code Sections.

    Using those tags is basically like putting the code within a comment. The comment is removed on publish so that your code stays intact once it's on the web server.

    Let me know if this helps.

    Thanks

  4. 4 Posted by weissm on 14 Jul, 2011 07:38 PM

    weissm's Avatar

    I'm not putting the code into Cascade, I am using Web Services calls to do it for me.

  5. 5 Posted by weissm on 14 Jul, 2011 08:47 PM

    weissm's Avatar

    I think I've found the solution.

    I guess pageToEdit.xhtml requires more than just the HTML fragment.

    I turned OutputBodyOnly off on Managed HTML Tidy and it worked.

  6. 6 Posted by weissm on 14 Jul, 2011 09:01 PM

    weissm's Avatar

    Actually, it looks like Cascade will publish it with those tags intact if you do that... the only valid option I can find is to wrap the XHTML in a

    tag.

    It looks like Cascade Web Services... or Cascade itself has some sort of Tree traversing problem if you are submitting HTML with no root node.

  7. 7 Posted by weissm on 14 Jul, 2011 09:02 PM

    weissm's Avatar

    That was supposed to be <div> tag.

  8. Support Staff 8 Posted by Tim on 14 Jul, 2011 09:05 PM

    Tim's Avatar

    RIght. Depending on how your Template is set up, you may need to make sure you have a root node surrounding your content. Otherwise, you'll likely see a similar error like this:

    Could not convert JDOM document into string: Exception outputting Document: Root element not set
    
  9. Tim closed this discussion on 12 Jan, 2012 08:13 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac