[ https://issues.apache.org/jira/browse/BETWIXT-67?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicholas W. updated BETWIXT-67:
-------------------------------
Attachment: Betwixt-67-proposed.patch
Proposed patch
> Betwixt does not correctly implement namespace scoping
> ------------------------------------------------------
>
> Key: BETWIXT-67
> URL: https://issues.apache.org/jira/browse/BETWIXT-67
> Project: Commons Betwixt
> Issue Type: Bug
> Reporter: Nicholas W.
> Priority: Critical
> Attachments: Betwixt-67-proposed.patch
>
>
> According to: http://www.w3.org/TR/xml-names/#scoping
> The scope of a namespace declaration declaring a prefix extends from the beginning of the start-tag in which it appears to the end of the corresponding end-tag, excluding the scope of any inner declarations with the same NSAttName part. In the case of an empty tag, the scope is the tag itself.
> Such a namespace declaration applies to all element and attribute names within its scope whose prefix matches that specified in the declaration.
> Namespace declarations are handled in the class AbstractBeanWriter in method addNamespaceDeclarations
> Each new namespace declaration is added to namespacesDeclared and written out to the attributes of an element just once. The declaration is made just once in any one object as it is written out. The result is:
> Using a dot betwixt file like this:
>
>
>
>
>
>
>
>
>
>
>
> And with the beanwriter having extra configuration of the NamespacePrefixMapper like this:
> prefixMapper.setPrefix("http://purl.org/dc/elements/1.1/", "dc");
> prefixMapper.setPrefix("http://www.openarchives.org/OAI/2.0/oai_dc/", "oai_dc");
> The XML generated is like this:
>
> Sample Title
> Sample Creator
> Sample Publisher
> Sample Description
> Sample Identifier
> Sample Subject
>
> Which is wrong. The namespace declaration should be in the parent element, or repeated in all the child elements.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.