Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
2.5
-
None
-
Operating System: All
Platform: All
-
40270
Description
[PATCH] This patch is needed to compensate for an error with Microsoft's Word
2003 WordprocessinML style sheet "Word2FO.xsl". McKesson is close to using FOP
at a pilot site and it would greatly help us if this change were made. I highly
doubt that we would experience a timely turn-around from Microsoft.
:::::::
As per Andreas Delmelle:
Hmm... We already allow table-bodies without child-nodes if strict validation is
turned off, so might as well add this. Not too much harm, I guess.
If it is producing list-item-labels without content --at least an empty block
would suffice-- then the stylesheet should be altered. It is resulting in FO
that does not adhere to the rules in the XSL-FO Rec, so it would be more
reasonable to change the stylesheet.
Either it should create an 'empty' list-item, with both label and body at least
containing an empty block, or it should not create a list-item at all.
:::::::
To reproduce:
<w:listPr>
<aml:annotation aml:id="2" aml:author="."
aml:createdate="2003-03-20T11:54:00Z" w:type="Word.Insertion"/> </w:listPr>
Which causes the exception:
org.apache.fop.fo.ValidationException: null:2:26031: Error(2/26031):
fo:list-item-label is missing child elements.
Required Content Model: marker* (%block+
at
org.apache.fop.fo.FONode.missingChildElementError(FONode.java:407)
at
org.apache.fop.fo.flow.AbstractListItemPart.endOfNode(AbstractListItemPa
rt.java:68)
at
org.apache.fop.fo.flow.ListItemLabel.endOfNode(ListItemLabel.java:49)
at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j
ava:378)
at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Transfor
merIdentityImpl.java:1103)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:494)
. . .
:::::::
To get around this I modified the endOfNode() method in
org.apache.fop.fo.flow.AbstractListItemPart to only throw this exception if
strict validation is configured. A patch file containing this modification is
attached.