Build fails when using CDATA tags

Topics: Conceptual Topics
Aug 5, 2011 at 4:54 PM
Edited Aug 5, 2011 at 5:06 PM

I need to preserve white space and soft returns in some text and tried using the cdata tags but as soon as I add them, the build fails.

I'm using the following:

<![CDATA[ my text here ]]>

but since this isn't working, I'm assuming there's something else I need to do in order to get what I need.

Thanks in advance.

ETA: Sometimes it will build, but it completely ignores the white space and returns and lumps everything together in one huge mass of text. Although it does preserve the code tags and such.

Coordinator
Aug 5, 2011 at 5:42 PM

Hi, 

Where are you adding it?  MAML or XML documentation in code?  Can you provide a small example?

Also, what is the exact error message?

- Dave

Aug 5, 2011 at 5:51 PM

There are no error messages, just that 1 failed and it quits. This is in a developer conceptual topic/how to, etc.

The forum isn't letting me post the code in the code tags, it is formatting it without the tags and throwing out the cdata section.

        <para>
          <![CDATA[
When the file is loaded, search for your API call. You'll find something similar to the following:

<wsdl:message name="IUserService_LoginUser_InputMessage">
<wsdl:part name="parameters" element="tns:LoginUser"/>
</wsdl:message>
<wsdl:message name="IUserService_LoginUser_OutputMessage">
<wsdl:part name="parameters" element="tns:LoginUserResponse"/>
</wsdl:message>
]]>
        </para> 

Aug 5, 2011 at 6:01 PM

And this is what it looks like when it does compile:

When the file is loaded, search for your API call. You'll find something similar to the following: <wsdl:message name="IUserService_LoginUser_InputMessage"> <wsdl:part name="parameters" element="tns:LoginUser"/> </wsdl:message> <wsdl:message name="IUserService_LoginUser_OutputMessage"> <wsdl:part name="parameters" element="tns:LoginUserResponse"/> </wsdl:message>

Coordinator
Aug 5, 2011 at 6:51 PM

Hi,

Well your CDATA section appears to be correct.  I'm also pretty sure that Sandcastle used to support CDATA sections in conceptual topics.  Are you still using the May 2008 release of Sandcastle?  DocProject is not compatible with the latest Sandcastle release.

To get the exact error message and the failing command line you probably have to set the MSBuild project build output verbosity setting in Visual Studio to Normal or higher.

http://msdn.microsoft.com/en-us/library/cyhcc7zc(v=VS.100).aspx

- Dave

Aug 5, 2011 at 7:01 PM

I am using the May 2008 release of Sandcastle. I'll have to have one of our devs look at the verbosity thing as that's over my head.

I'm currently putting the CDATA tag in front of every line of the PHP code and that's getting around it but isn't optimal since it puts too much space between the lines.