Menu

#16 Namespace prefix handling

open
nobody
5
2011-02-23
2011-02-23
Anonymous
No

From my understanding the way to add a wanted prefix to an element is to use @Namespace(reference="something"). But that sort of destroys the idea of having a prefix which is supposed to operate as an alias, not having to type the long URLs.
When I tried @Namespace(prefix="something") the generated XML contained an empty xmlns declaration as well.
My suggestion is that declaring @Namespace(prefix="something") means that only the prefix is added to the element name, no xmlns declaration.
If this is not possible due to some additional need to use prefix to set empty xmlns then I suggest that you introduce something like @Namespace(alias="something") that will only prepend the element.

Discussion

  • Niall Gallagher

    Niall Gallagher - 2011-04-08

    This is the way it works now, if you have already added the URL then it does not get added again if its within scope.

     
  • Niall Gallagher

    Niall Gallagher - 2011-04-28

    You can do this already, if you declare only the namespace, it will inherit the prefix from any previous declaration.

     

Log in to post a comment.