InfoPath throws Errormessage after using CopyRichText Command - InfoPath Dev
in

InfoPath Dev

InfoPath throws Errormessage after using CopyRichText Command

Last post 11-15-2010 11:53 AM by Jim Cantwell. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-12-2010 03:05 AM

    InfoPath throws Errormessage after using CopyRichText Command

    Hallo,

    I am using CopyRichText to copy a RichText Field from another datasource into the Main Datasource and get the following error from InfoPath:

    Only one top level element is allowed in an XML document.

    Line 25, Position 2
    <div>&#160;</div>
    -^

    The error comes as soon as I click somewhere in my form after the rule has finished. I can perfectly reproduce this behaviour. The error does not occur with every xml-file, that I bind in as the secondary datasource, however, if it occurs, it occurs everytime with that file. The other xml-File is an InfoPath-Form that I can open and that is perfectly shown and rendered.

    The qrules command should be correct, since it works very well with the files, that the error does not occur with.

    concat("CopyRichText /xpathdest=", ../my:XPathMainField, " /dsnamesrc=VorlageVersuchsbericht /xpathsrc=", ../my:XPathTemplateField)

    So, mabye you have seen this kind of behaviour and can help me?

    thanks
    Best regards
    Michael

     


    Filed under:
  • 11-12-2010 04:54 AM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    Hi Michael,

    Can you attach the XML? Our CopyRichText guru (Hilary) is off today but will be back Monday. I'll take a look at your XML, but my guess is that it's a problem with the XHTML format.

    More later today, 

    Patrick Halstead
    Project Manager at Qdabra
  • 11-12-2010 07:18 AM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    Hallo Patrick,

    I attached the XML File. There are about 5 Richtext fields in it, that can cause this error, I cleared the other Richtext Fields to stay below your attachment size.

    Please have a look at the RichText Field at this xpath:

    /my:versuchsbericht/my:versuchsaufbauPrfmittel/my:versuchsaufbau/my:text

    I will reply again and attach a file, that does not throw an error like this.

    Update: I just deleted the file attachment.

  • 11-12-2010 07:23 AM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    this 9997-file does not cause the error on import.

    the other 9998-file in the post before this does (just to be clear)

    Michael

    update: I just deleted the file attachment.

  • 11-12-2010 12:05 PM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    The primary difference in the files is the 9998 file has an embedded image.  But this is working in our test template using your 9998 file.  Can you send your xsn to our support alias?

    What are the values you are using in /my:XPathMainField and /my:XPathTemplateField?

     

  • 11-12-2010 01:28 PM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    My xsn ist 280kb in size plus code (zip didn't make it much smaller). Maybe I can send it via email to you?

    I tried to narrow it down: When the following line is at the end of the RichTextField the error occurs. When I delete it and import the RichText, it works. I don't know, how I should interpret this behaviour. I mean, I can't tell what could be wrong with that tag.

    <div style="MARGIN-TOP: 0pt; TEXT-INDENT: 0in; PADDING-LEFT: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0pt; language: de" align="left" xmlns="http://www.w3.org/1999/xhtml"><font style="FONT-SIZE: 11pt"><span style="language: de"></span>MP - measurement point </font></div>

    I noticed the image as well, but as far as I can tell from my testing, it is not the problem.

    XPathTemplateField and XPathMainField are both textfields, that I store the xpaths for the source- and target node in. You see, in total, I copy seven such Richtextfields from the template file. So for design reasons I have one rule, that builds the string for the qrules Command and refers to these proxy fields and I call this rule seven times from the other rules (that among other things set the correct xpaths of course).

    I tried to copy by code the innerXML with no better result in the end. Then I tried to copy the outerXML, that didn't work either. It puzzles me, since the other template file opens and renders ok. So if I copy the outerXML of RichText, why shouldn't it work? Isn't it simple text at that level without interpretation of tags?

    With the form-design itself I am quite happy and it works for many templates that users would import later. I have no statistic how many files this error occurs on yet. But the concept was ok so far, I thought.

    Thx
    Michael

  • 11-12-2010 02:03 PM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    I'm sorry, you were asking for the values of the two fields, not the way I put them to work, of course :-)

    Well their values are absolute xpaths to the two RichTextFields, one in MainSource. i.E.: /my:versuchsbericht/my:versuchsaufbauPrfmittel/my:versuchsaufbau/my:text

    and the other would be the same for that field, so again: /my:versuchsbericht/my:versuchsaufbauPrfmittel/my:versuchsaufbau/my:text, but of course the data source is different. The data source is a XML File Data Connection.

    These paths don't differ in this case, but they can and do for other fields, when the form design had changed from one version to the next.

    Michael

  • 11-15-2010 11:53 AM In reply to

    Re: InfoPath throws Errormessage after using CopyRichText Command

    The nodes from 9998 copied without an error in my test form.  Please email your xsn to support at qdabra.com and we'll see if we can repro.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.