Problem with "split" in context menu

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ghudson
Posts: 12
Joined: Tue Feb 08, 2011 11:40 pm

Problem with "split" in context menu

Post by ghudson »

Here is a snippet from a simple document which is valid in our schema. I have ommitted some elements for clarity:

Code: Select all


<Body>

<P>Location 1: works correctly</P>

</Body>

<SubCaption>

<P>Location 2: splits subcaption instead of P</P>

</SubCaption>
The issue is, when placing the cursor in position 1 (in author mode), the context menu shows "Split P", which is the desired behavior.
When placing the cursor in position 2, the context menu shows "Split Subcaption", we would like it to be like position 1, "Split P"

Here are the relevant parts of the schema:

Code: Select all

<xs:complexType name="SubCaptionType">
<xs:sequence maxOccurs="unbounded">
<xs:element ref="tns:P" minOccurs="0" />
<xs:element ref="tns:TextNote" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="BodyType">
<xs:sequence maxOccurs="unbounded">
<xs:element ref="tns:TextNote" minOccurs="0"/>
<xs:element ref="tns:CodNote" minOccurs="0"/>
<xs:element ref="tns:P" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
Any ideas as to what is causing this, and what could be done to change it?

Thanks, Glenn
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Problem with "split" in context menu

Post by george »

Hi Glenn,

Only block level elements can be split. If your SubCaption element is defined by the CSS as a block element and the P element inside SubCaption is not a block element then oXygen will offer the split action on the SubCaption element. Please make sure your CSS defines also SubCation P as block.

Here it is an example that reproduces your problem
test.xml

Code: Select all


<?xml-stylesheet type="text/css" href="test.css"?>
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="test.xsd">
<Body>
<P>Location 1: works correctly</P>
</Body>
<SubCaption>
<P>Location 2: splits subcaption instead of P</P>
</SubCaption>
</test>
test.css

Code: Select all


test {
display : block;
}
Body {
display : block;
}
SubCaption {
display : block;
}
Body P {
display : block;
}
test.xsd

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="test" type="test_type"/>

<xs:complexType name="test_type">
<xs:sequence>
<xs:element name="Body" type="BodyType"/>
<xs:element name="SubCaption" type="SubCaptionType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:simpleType name="type_x">
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>

<xs:complexType name="SubCaptionType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="P" minOccurs="0" type="xs:string"></xs:element>
<xs:element name="TextNote" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="BodyType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="TextNote" minOccurs="0"/>
<xs:element name="CodNote" minOccurs="0"/>
<xs:element name="P" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>

</xs:schema>
Then, changing the CSS to add

Code: Select all


Body P {
display : block;
}
makes the "Split P" action appear also on the second P element.

Best Regards,
George
George Cristian Bina
ghudson
Posts: 12
Joined: Tue Feb 08, 2011 11:40 pm

Re: Problem with "split" in context menu

Post by ghudson »

Thanks George, that was the issue!
Post Reply