You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Derek Mordarski (JIRA)" <xm...@xml.apache.org> on 2009/06/20 19:12:07 UTC

[jira] Commented: (XMLBEANS-403) Prefix used to escape restricted words in part of a namespace is hardcoded, unconfigurable.

    [ https://issues.apache.org/jira/browse/XMLBEANS-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722219#action_12722219 ] 

Derek Mordarski commented on XMLBEANS-403:
------------------------------------------

I have found that the class org.apache.xmlbeans.impl.common.QNameHelper also exploits a similar problem.

For example:
If your namespace URI is: http://www.ACORD.org/standards/PC_Surety/ACORD1.10.0/xml/

The method: public static String suggestPrefix(String namespace) will return an illegal prefix: x/

Your XML serialized output the ends up looking like:

<xml-fragment xmlns:x/="http://www.ACORD.org/standards/PC_Surety/ACORD1.10.0/xml/">

    <!-- Notice the illegal non-encoded forward slash used in the prefix name -->
    <x:/some-parent-node>Some text</some-parent-node>

</xml-fragment>

I have found that this is due to a bug in an algorithm within the QNameHelper::suggestPrefix(..) method.
I have made a fix to my local version of this class in order to get around this bug.

If nobody is working on this bug, I'd be glad to fix it.




> Prefix used to escape restricted words in part of a namespace is hardcoded, unconfigurable.
> -------------------------------------------------------------------------------------------
>
>                 Key: XMLBEANS-403
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-403
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: Version 2.4.1 
>         Environment: Any
>            Reporter: Martin Barrs
>
> Path elements in a namespace that are considered reserved etc, are changed by the code to be prefixed with an 'x'.
> This prefix is hardcoded in each instance it is used - it is not event a static.
> Code: org.apache.xmlbeans.impl.common.NameUtil
> Lines: 631
> This prefix should also be configurable so that it can mesh with other generated systems, i.e. Axis (see AXIS2-4269).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org