aspose file tools*
The moose likes XML and Related Technologies and the fly likes QName to string w/ prefix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "QName to string w/ prefix" Watch "QName to string w/ prefix" New topic
Author

QName to string w/ prefix

Theodore David Williams
Ranch Hand

Joined: Dec 21, 2009
Posts: 102
I cannot seem to find a standard way to get a QName as a string with the prefix as output after mashaling to XML.

I.E. when I marshal to XML I get


Is there a standard way to turn a QName into this string?

Of course I could do:

QName qName = .....
String withPrefix = qName.getPrefix() + ":" + qName.getLocalName();


But that seems messy.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 462
    
    2
But that seems messy.

Maybe not that messy after all. Messiness is not of short supply, but that is far from being one, no? On the flip-side, one should guard against unnecessary proliferation of methods...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: QName to string w/ prefix
 
Similar Threads
problem with JAXP
Create XML file by using data in Access
runtime encoding probolem
Different Behavior between SAAJ Implementations (Axis2 and glassfish)
dii client problems..help!