problems to display #PCDATA as choice-Element

Dear Support-Team,

I can’t display #PCDATA as element in a choice. I described it detailed in the file “ProblemBeschreibung2.rtf”. You get this file as attachment.

Thank you for your help in advance.

Yours sincerely

[This message was edited by Christian Freytag on 21 Mar 2003 at 09:01.]
ProblemBeschreibung2.rtf (310 Bytes)

Hello Irfan,

according to the RTF file where you described your problem you refer to the DTD representation of your underlying schema, e.g.

<BR><!ELEMENT AusA (#PCDATA | sup | SimpleLink | zyx | AngabeZusatz)*  ><BR></pre><BR><BR>XApplication and the data within Tamino are based on the Tamino Schema (TSD3). There is no PCDATA. Use the X-Plorer and have a look at the schema definition. There should be something like<BR><BR><pre class="ip-ubbcode-code-pre"><BR><element name="AusA"><BR>  <complexType><BR>    <choice minOccurs="0" maxOccurs="unbounded"><BR>      ???<BR>    </choice><BR>  </complexType><BR></element><BR>



Could you check the part ???. It defines the possible choices for your elements within AusA. They can for the type attribute of the choice tag.

Bye,
Christian.

Hello Christian,

AusA element as XML Schema is as following:

<xsd:element name=‘AusA’>
<xsd:complexType mixed=‘true’>
<xsd:choice minOccurs=‘0’ maxOccurs=‘unbounded’>
<xsd:element ref=‘sup’/>
<xsd:element ref=‘SimpleLink’/>
<xsd:element ref=‘zyx’/>
<xsd:element ref=‘AngabeZusatz’/>
</xsd:choice>
</xsd:complexType>
</xsd:element>

By,
Irfan

Hello Irfan,

the problem is the mixed content of the element AusA. “Mixed Content” means that Text can appear between two elemnts of the choice tags, eg.

<BR><AusA><BR>   Text 1<sup>...</sub>Text 2<SimpleLink>...</SimpleLink><BR>   <sup>...</sup>text at the end<BR></AusA><BR></pre><BR><BR>To handle the text nodes ("Text 1", "Text 2", ...) is currently not supported by X-Application.<BR><BR>Is it possible for you to change the schema for the text is enclosed by an element?<BR><BR>E.g.<BR><pre class="ip-ubbcode-code-pre"><BR><xsd:element name='AusA'><BR>  <xsd:complexType><BR>    <xsd:choice minOccurs='0' maxOccurs='unbounded'><BR>      <xsd:element ref='txt'/><BR>      <xsd:element ref='sup'/><BR>      <xsd:element ref='SimpleLink'/><BR>      <xsd:element ref='zyx'/><BR>      <xsd:element ref='AngabeZusatz'/><BR>    </xsd:choice><BR>  </xsd:complexType><BR></xsd:element><BR><xsd:element name='txt' type='xsd:string'/><BR>

Hello Christian?

when will X-Application support mixed content? In the next release?

Bye,
Irfan

Hello Irfan,

for the next version 3.1.3, mixed content is not directly supported in a way you could use it. However, the next version allows you to plugin application specific code.

A possible solution could look like this:

<BR><xapp:loop select=".../AusA" ...><BR>   ...<BR>   <xapp:if condition="hasTextBefore"><BR>      <xapp:directelementaction type="getTextBefore" select="."/><BR>   </xapp:if><BR>   <xapp:choice ...><BR>     ...<BR>   </xapp:choice><BR></xapp:loop><BR>



The condition “hasTextBefore” would be a plugin which checks whether the current choice node contains plain text before or not.

The elementaction “getTextBefore” returns this Text.

In this way you could output also the text nodes which would be ignored otherwise. The other nodes can be processed by the choice tag.

I cannot guarantee that this roughly described idea will work. We should try it out when the new version comes up. Currently, I have not the time to check it, perhaps at the beginning of August.

Bye,
Christian.

[This message was edited by Christian Freytag on 17 Jul 2002 at 12:03.]

Hello,

with the new XPath evaluation embedded in X-Application 4.1.1 it is possible to display / edit mixed content nodes.

Interesting Simple Examples within this context are:
- Mixed Content
- Raw Content

A special Plugin solution is not longer required.

Bye,
Christian.