Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • psiho 101 posts 96 karma points
    Nov 04, 2011 @ 10:36
    psiho
    0

    How to get rid of " in Contour export

    I'm trying to do custom export of Contour records to CSV file. I'm using XSLT macro to do it and everything seems ox except quotes. It turns out that quotes entered in Contour forms are stored in database as:

    <![CDATA[&quot;Test quotes&]]>

    I'm not sure why this is so, if CDATA is used I expected quotes to be left as are. but anyway, in my XSLT export, line <xsl:value-of select="created" disable-output-escaping="yes"/> creates output:

    &quot;Test quotes&

    Which is not good for export file. It shold be:

    "Test"

    I don't know how to resolve this.


     

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Nov 08, 2011 @ 13:56
    Tim
    1

    Hiya,

    Try removing the disable output escaping property, that should render it with the quotes I think.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 08, 2011 @ 14:01
    Tom Fulton
    0

    What Tim said :)

    Also, you might have a look at /umbraco/plugins/umbracoContour/xslt/excel.xslt, which is an XSLT file that ships with Contour that converts records into CSV for Excel (used in the export dropdown).  Might help you out.

    -Tom

  • psiho 101 posts 96 karma points
    Nov 11, 2011 @ 15:05
    psiho
    0

    I remember trying that too and it was worse. I also tried regular export (/umbraco/plugins/umbracoContour/xslt/excel.xslt) but that also does not export ok, although results are wierd: first quote is interpreted ok, and second one is just merged with couple of next fields.

    Reason I'm talking in past tense is that I ran into another problem that does not allow me to test further. My export started returning no records. Debugging it with "visualise XSLT":

    <xsl:value-of select="umbraco.contour:GetRecordsFromForm('56984134-7139-453a-87d2-04e8f1ade00e')/uformrecord [state = 'Approved']"/>

    ... generates no output, while:

    <xsl:value-of select="umbraco.contour:GetRecordsFromForm('56984134-7139-453a-87d2-04e8f1ade00e')"/>

    generates this exception:

    Error parsing the XSLT:

    System.ArgumentException: '', hexadecimal value 0x12, is an invalid character. at System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar(Int32 ch, Char* pDst, Boolean entitize) at System.Xml.XmlEncodedRawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd) at System.Xml.XmlEncodedRawTextWriter.WriteString(String text) at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteString(String text, Boolean disableOutputEscaping) at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object sender, EventArgs e)

  • psiho 101 posts 96 karma points
    Nov 14, 2011 @ 15:29
    psiho
    0

    Ah, I don't know how above problem happened but somehow record in database was corrupted. XMLrecord text eded wit CDATA[". I deleted this record and now back in business... or better to say back to original problem and that is exporting text with quotes.

    Suggestion above, to remove output escaping produces even worse results. "Test" is exported as:

    &amp;quot;Test&amp;quot;;

    So still, I don't know how to export quotes from Contour using XSLT macro.

Please Sign in or register to post replies

Write your reply to:

Draft