0 votes
in SoSci Survey (English) by s289608 (110 points)

Dear SoSci Survey Support Team,

We are a team from the Medical University of Vienna working on designing a questionnaire using SoSci Survey. We are attempting to construct a table within our survey by importing an XML file, but we are encountering multiple errors during the import process.

Our goal is to collect detailed information about pregnancies from respondents, including dates, durations, outcomes, and breastfeeding information. We tried to structure the XML file according to the guidelines provided, but the import system returns numerous warnings and errors.

Here is a portion of the XML code we used:

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE surveyContent SYSTEM "https://www.soscisurvey.de/templates/doctype.survey.dtd">
<surveyContent version="2.4" type="question">
  <program>oFb</program>
  <version>3.6.04</version>
  <language>deu</language>
  <title>Schwangerschaften</title>
  <description>Schwangerschaftsdaten</description>

  <question columns="6">
    <description>Schwangerschaftsverlauf</description>
    <class>input</class>
    <title><![CDATA[Bitte tragen Sie Ihre Schwangerschaften ein.]]></title>
    
    <!-- Column Headers -->
    <item>
      <text></text>
      <text><b>Datum Ende der Schwangerschaft</b></text>
      <text><b>Länge der Schwangerschaft in Wochen</b></text>
      <text><b>Ausgang</b></text>
      <text><b>Stillen</b></text>
      <text><b>Dauer in Monaten</b></text>
    </item>

    <!-- Pregnancy Entries -->
    <!-- ... (Pregnancy items here) ... -->
    
  </question>
</surveyContent>

`

The errors and warnings we received are as follows:

Warning: There is an unknown attribute b in the XML file (line 18, col 15, import module ExchangeItem). Warning: There is an unknown attribute b in the XML file (line 19, col 15, import module ExchangeItem). Warning: There is an unknown attribute b in the XML file (line 20, col 15, import module ExchangeItem). Warning: There is an unknown attribute b in the XML file (line 21, col 15, import module ExchangeItem). Warning: There is an unknown attribute b in the XML file (line 22, col 15, import module ExchangeItem). Warning: There is an unknown attribute inputField in the XML file (line 28, col 54, import module ExchangeItem). Warning: There is an unknown attribute inputField in the XML file (line 29, col 57, import module ExchangeItem). Warning: There is an unknown attribute select in the XML file (line 30, col 41, import module ExchangeItem). Warning: There is an unknown attribute select in the XML file (line 37, col 37, import module ExchangeItem). Warning: There is an unknown attribute inputField in the XML file (line 41, col 64, import module ExchangeItem). ... (additional warnings truncated for brevity) ...

Our Questions and Requests:

  1. Proper Table Construction: We are unsure how to correctly construct a table within the XML file for SoSci Survey. Could you provide guidance or examples on how to create a table layout that the import system will accept?

  2. Understanding Errors: The warnings mention unknown attributes like b, inputField, and select. We believed these were valid elements based on the documentation. Are we missing something in our understanding of the XML schema used by SoSci Survey?

  3. Correct Usage of Elements: We suspect that the use of <b> tags and other HTML elements within <text> might be causing some of the issues. Could you clarify the correct way to format text with bold headers in the column titles?

  4. Sample XML Template: If possible, could you provide a sample XML template that demonstrates how to set up a question with multiple input fields arranged in a table format?

We appreciate any assistance you can provide, as we aim to ensure our questionnaire is both functional and user-friendly for our respondents.

Thank you for your time and support.

Best regards

by s109993 (11.8k points)
Not an Admin here: But I have question, why do you need to construct the table with XML? Why can you not just construct a html table in SoSci and fill it with questions? Your approach seems just very difficult compared to the alternatives :)

1 Answer

0 votes
by SoSci Survey (325k points)

Let me begin with a technical issue:

<item>
  <text></text>
  <text><b>Datum Ende der Schwangerschaft</b></text>
  <text><b>Länge der Schwangerschaft in Wochen</b></text>
  <text><b>Ausgang</b></text>
  <text><b>Stillen</b></text>
  <text><b>Dauer in Monaten</b></text>
</item>

To use HTML code within XML code, plese us <![CDATA[, for example:

<item>
  <text></text>
  <text><![CDATA[<b>Datum Ende der Schwangerschaft</b>]]></text>
  <text><![CDATA[<b>Länge der Schwangerschaft in Wochen</b>]]></text>
  <text><![CDATA[<b>Ausgang</b>]]></text>
  <text><![CDATA[<b>Stillen</b>]]></text>
  <text><![CDATA[<b>Dauer in Monaten</b>]]></text>
</item>

That allows XML characters within the XML without replacing them by Entities (&lt; etc.)

Proper Table Construction: We are unsure how to correctly construct a table within the XML file for SoSci Survey.

The question is, how to contruct a table in SoSci Survey. Often combined questions are a good way to go - however, if you need more information per row, you should take a look at the multi-level feature, an especially at the Multi Level question type.

Then, the question is, what is your intention behind using XML?

Sample XML Template: If possible, could you provide a sample XML template that demonstrates how to set up a question with multiple input fields arranged in a table format?

Please, start creating those questions in the user interface of SoSci Survey, using a combined question. Then export the section as XML file to get the template.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...