Re: confirm subscribe to fop-dev@xmlgraphics.apache.org

2006-08-15 Thread Andreas L Delmelle

On Aug 16, 2006, at 00:49, Reed, Gary wrote:


Thanks Andreas.

It's not a problem with the style sheet. MS Word creates the empty  
list.


Yes it is :)
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.



Following is Microsoft's description of the listpr element. It doesn't
explicitly address empty lists. Therefore, I think my proposed
modification is reasonable. I'll read up on the FOP website about  
how to

submit code changes for consideration and see what happens.


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.


But again, strictly speaking, it's the stylesheet that is in error  
here and should be fixed.



Cheers,

Andreas



RE: confirm subscribe to fop-dev@xmlgraphics.apache.org

2006-08-15 Thread Reed, Gary

Thanks Andreas. 

It's not a problem with the style sheet. MS Word creates the empty list.
Following is Microsoft's description of the listpr element. It doesn't
explicitly address empty lists. Therefore, I think my proposed
modification is reasonable. I'll read up on the FOP website about how to
submit code changes for consideration and see what happens. 

Thanks, Gary


Lists

In WordprocessingML, lists are a series of paragraphs that have a list
style applied to them, with each item in the list in a separate
paragraph. What distinguishes a "list paragraph" from an ordinary
paragraph is the presence of a listPr element in the pPr element in the
paragraph. The listPr element specifies the list style to be used with
the paragraph's content and the level of the list. Here is a sample of a
list with two items, which are represented by the two paragraphs with
listPr elements:


   
  
  
  
  
   
   
  Item 1 
   


   
  
  
  
  
   
   
  Item 2 
   


Only two elements can appear inside the listPr element:

* ilvl: The list's level number. This number is incremented as lists
are nested within lists.
* ilfo: The list style to use. This number must refer to a list
style defined in the lists element. 


Gary Reed
Horizon Anatomic Pathology Development 
McKesson Provider Technologies 
541.681.8265 
mailto:[EMAIL PROTECTED] 
This e-mail message, including any attachments, is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.

-Original Message-
From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 15, 2006 3:12 PM
To: fop-dev@xmlgraphics.apache.org
Subject: Re: confirm subscribe to fop-dev@xmlgraphics.apache.org

On Aug 16, 2006, at 00:03, Reed, Gary wrote:

Hi,


>
> 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:


> Does anyone see a problem with this?

Not an immediate problem, but then again, if the stylesheet produces
invalid FO, then it would probably be wiser, in the long term, to submit
a patch to Microsoft's XSL...


HTH!

Cheers,

Andreas



Re: confirm subscribe to fop-dev@xmlgraphics.apache.org

2006-08-15 Thread Andreas L Delmelle

On Aug 16, 2006, at 00:03, Reed, Gary wrote:

Hi,




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:




Does anyone see a problem with this?


Not an immediate problem, but then again, if the stylesheet produces  
invalid FO, then it would probably be wiser, in the long term, to  
submit a patch to Microsoft's XSL...



HTH!

Cheers,

Andreas



RE: confirm subscribe to fop-dev@xmlgraphics.apache.org

2006-08-15 Thread Reed, Gary
All,

I'm new to the FOP world and am not real familiar with the code. I've
got a situation where Word 2003 has produced an XML file (i.e.,
WordprocessingML) that's been converted to an FO file via the Microsoft
provided xsl file. The xml file contains the following snippet:





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:

/**
 * @see org.apache.fop.fo.FONode#endOfNode
 */
protected void endOfNode() throws FOPException {
if (!this.blockItemFound) {
String contentModel = "marker* (%block;)+";
if (getUserAgent().validateStrictly()) {
missingChildElementError(contentModel);
}
else {
StringBuffer message = new
StringBuffer(errorText(getLocator()));
message.append(getName());
message.append(" is missing child elements. \nRequired
Content Model: "); 
message.append(contentModel);
getLogger().warn(message.toString());
}
}
}

Does anyone see a problem with this?

Thank you,

Gary Reed
Horizon Anatomic Pathology Development 
McKesson Provider Technologies 
541.681.8265 
mailto:[EMAIL PROTECTED] 
This e-mail message, including any attachments, is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.