git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1343133 13f79535-47bb-0310-9956-ffa450edef68tags/fop-1_1rc1^2
<xs:element ref="mf:page-sequence" minOccurs="1" maxOccurs="unbounded"/> | <xs:element ref="mf:page-sequence" minOccurs="1" maxOccurs="unbounded"/> | ||||
<xs:element ref="mf:trailer"/> | <xs:element ref="mf:trailer"/> | ||||
</xs:sequence> | </xs:sequence> | ||||
<xs:attribute name="version" type="xs:string"/> | |||||
</xs:complexType> | </xs:complexType> | ||||
</xs:element> | </xs:element> | ||||
<xs:element name="header"> | <xs:element name="header"> |
public class IFSerializer extends AbstractXMLWritingIFDocumentHandler | public class IFSerializer extends AbstractXMLWritingIFDocumentHandler | ||||
implements IFConstants, IFPainter, IFDocumentNavigationHandler { | implements IFConstants, IFPainter, IFDocumentNavigationHandler { | ||||
/** | |||||
* Intermediate Format (IF) version, used to express an @version attribute | |||||
* in the root element of the IF document, the initial value of which | |||||
* is set to '2.0' to signify that something preceded it (but didn't | |||||
* happen to be marked as such), and that this version is not necessarily | |||||
* backwards compatible with the unmarked (<2.0) version. | |||||
*/ | |||||
public static final String VERSION = "2.0"; | |||||
private IFDocumentHandler mimicHandler; | private IFDocumentHandler mimicHandler; | ||||
private int pageSequenceIndex; // used for accessibility | private int pageSequenceIndex; // used for accessibility | ||||
DocumentNavigationExtensionConstants.NAMESPACE); | DocumentNavigationExtensionConstants.NAMESPACE); | ||||
handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX, | handler.startPrefixMapping(InternalElementMapping.STANDARD_PREFIX, | ||||
InternalElementMapping.URI); | InternalElementMapping.URI); | ||||
handler.startElement(EL_DOCUMENT); | |||||
AttributesImpl atts = new AttributesImpl(); | |||||
addAttribute(atts, "version", VERSION); | |||||
handler.startElement(EL_DOCUMENT, atts); | |||||
} catch (SAXException e) { | } catch (SAXException e) { | ||||
throw new IFException("SAX error in startDocument()", e); | throw new IFException("SAX error in startDocument()", e); | ||||
} | } |
*/ | */ | ||||
public class XMLRenderer extends AbstractXMLRenderer { | public class XMLRenderer extends AbstractXMLRenderer { | ||||
/** | |||||
* Area Tree (AT) version, used to express an @version attribute | |||||
* in the root element of the AT document, the initial value of which | |||||
* is set to '2.0' to signify that something preceded it (but didn't | |||||
* happen to be marked as such), and that this version is not necessarily | |||||
* backwards compatible with the unmarked (<2.0) version. | |||||
*/ | |||||
public static final String VERSION = "2.0"; | |||||
/** XML MIME type */ | /** XML MIME type */ | ||||
public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE; | public static final String XML_MIME_TYPE = MimeConstants.MIME_FOP_AREA_TREE; | ||||
if (userAgent.getProducer() != null) { | if (userAgent.getProducer() != null) { | ||||
comment("Produced by " + userAgent.getProducer()); | comment("Produced by " + userAgent.getProducer()); | ||||
} | } | ||||
startElement("areaTree"); | |||||
atts.clear(); | |||||
addAttribute("version", VERSION); | |||||
startElement("areaTree", atts); | |||||
} | } | ||||
/** {@inheritDoc} */ | /** {@inheritDoc} */ | ||||
} | } | ||||
maybeAddLevelAttribute(word); | maybeAddLevelAttribute(word); | ||||
maybeAddPositionAdjustAttribute(word); | maybeAddPositionAdjustAttribute(word); | ||||
if ( word.isReversed() ) { | |||||
addAttribute("reversed", "true"); | |||||
} | |||||
String text = word.getWord(); | |||||
maybeAddReversedAttribute(word, text); | |||||
startElement("word", atts); | startElement("word", atts); | ||||
characters(word.getWord()); | |||||
characters(text); | |||||
endElement("word"); | endElement("word"); | ||||
super.renderWord(word); | super.renderWord(word); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
private void maybeAddReversedAttribute ( WordArea w, String text ) { | |||||
if ( w.isReversed() && ( text.length() > 1 ) ) { | |||||
addAttribute("reversed", "true"); | |||||
} | |||||
} | |||||
} | } |
documents. Example: the fix of marks layering will be such a case when it's done. | documents. Example: the fix of marks layering will be such a case when it's done. | ||||
--> | --> | ||||
<release version="FOP Trunk" date="TBD"> | <release version="FOP Trunk" date="TBD"> | ||||
<action context="Renderers" dev="GA" type="fix" fixes-bug="53304,53306"> | |||||
Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format. | |||||
</action> | |||||
<action context="Renderers" dev="GA" type="fix" fixes-bug="53295" due-to="Luis Bernardo"> | <action context="Renderers" dev="GA" type="fix" fixes-bug="53295" due-to="Luis Bernardo"> | ||||
Add extension to place code just before PostScript %PageTrailer. | Add extension to place code just before PostScript %PageTrailer. | ||||
</action> | </action> |
<fo:table-cell margin-left="0" text-align="right"> | <fo:table-cell margin-left="0" text-align="right"> | ||||
<fo:block> | <fo:block> | ||||
<fo:inline> | <fo:inline> | ||||
<fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">X</fo:bidi-override></fo:inline> | |||||
<fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">XY</fo:bidi-override></fo:inline> | |||||
</fo:inline> | </fo:inline> | ||||
</fo:block> | </fo:block> | ||||
</fo:table-cell> | </fo:table-cell> | ||||
<fo:table-cell margin-left="0" text-align="right"> | <fo:table-cell margin-left="0" text-align="right"> | ||||
<fo:block> | <fo:block> | ||||
<fo:inline> | <fo:inline> | ||||
<fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">X</fo:bidi-override></fo:inline> | |||||
<fo:inline><fo:bidi-override unicode-bidi="bidi-override" direction="rtl">XY</fo:bidi-override></fo:inline> | |||||
</fo:inline> | </fo:inline> | ||||
</fo:block> | </fo:block> | ||||
</fo:table-cell> | </fo:table-cell> |
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/@ipd"/> | <eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/@ipd"/> | ||||
<eval expected="4" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]"/> | <eval expected="4" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]"/> | ||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@level"/> | <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@level"/> | ||||
<true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed)"/> | |||||
<eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed"/> | |||||
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/@ipd"/> | <eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/@ipd"/> | ||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]"/> | <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]"/> | ||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@level"/> | |||||
<true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[1]/word[1]/@reversed)"/> | |||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]/@level"/> | |||||
<eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[2]/word[1]/@reversed"/> | |||||
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/@ipd"/> | <eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/@ipd"/> | ||||
<eval expected="2" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]"/> | <eval expected="2" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]"/> | ||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@level"/> | <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@level"/> | ||||
<true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@reversed)"/> | |||||
<eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[3]/word[1]/@reversed"/> | |||||
<eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/@ipd"/> | <eval expected="6672" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/@ipd"/> | ||||
<eval expected="1" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]"/> | <eval expected="1" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]"/> | ||||
<eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@level"/> | <eval expected="3" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@level"/> | ||||
<true xpath="boolean(//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@reversed)"/> | |||||
<eval expected="" xpath="//flow/block[2]/block[1]/block[1]/lineArea/inlineparent/text[4]/word[1]/@reversed"/> | |||||
</checks> | </checks> | ||||
</testcase> | </testcase> |