[ http://jira.codehaus.org/browse/DOXIA-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_124981 ]
Lukas Theussl commented on DOXIA-204: ------------------------------------- I don't see any way to ensure that parsers will use the correct attribute names. The only thing we can do is document, in the sink api, what attributes are supposed to be recognized for a given sink event. IMO it should be the standard HTML attributes for the corresponding html output, eg for the figure event above I have the following for now: {code} private static final String[] BASE_ATTRIBUTES = { Attribute.ID.toString(), Attribute.CLASS.toString(), Attribute.TITLE.toString(), Attribute.STYLE.toString(), Attribute.LANG.toString() }; private static final String[] IMG_ATTRIBUTES = { Attribute.SRC.toString(), Attribute.ALT.toString(), Attribute.WIDTH.toString(), Attribute.HEIGHT.toString(), Attribute.ALIGN.toString(), Attribute.BORDER.toString(), Attribute.HSPACE.toString(), Attribute.VSPACE.toString(), Attribute.ISMAP.toString(), Attribute.USEMAP.toString() }; {code} However, I don't quite see what your problem is. A parser is not a validator, it should just pass on the information it receives. It's the sink that should then decide what to do with each attribute it receives. Eg if the XWiki parser emits an attribute that the XhtmlSink does not understand (ie is not one of the above), then it will simply be ignored by the sink, while the XWiki Sink will know what to do with it. Of course, it has to be documented in the XWiki parser api which attributes are used in addition to the standard ones. Also note that I want to add the above to the current API, not replace any existing methods. > Add generic parameters support to Figure and Link events > -------------------------------------------------------- > > Key: DOXIA-204 > URL: http://jira.codehaus.org/browse/DOXIA-204 > Project: Maven Doxia > Issue Type: Improvement > Components: Sink API > Affects Versions: 1.0-alpha-10 > Reporter: Vincent Massol > Fix For: 1.0-beta-1 > > > For example XWiki has the following syntax for image macros and links: > * image: http://code.xwiki.org/xwiki/bin/view/Macros/ImageMacro > * links: http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax#HLinks > For the image macro there are the "document" and "fromincludingdoc" which are > specific to XWiki and thus cannot be put as standard parameters. > Same for links. > Thus I propose to allow parsers to pass a Map of properties (pair/values) to > the Sink API so that sinks can be written to understand them (the XWiki sink > would understand them for example). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira