Show namespaces of elements

This should cover W3C XML Schema, Relax NG and DTD related problems.
Greg
Posts: 2

Show namespaces of elements

Wed Nov 12, 2014 7:42 pm

I have an XML doc that is validated with a Schema. With the XML Editor, is it possible to find out what namespace the schema processor thinks an unqualified name is in? For example, can I get a copy of the XML doc but with any unqualified names replaced by qualified names?
Thanks.
Greg Reese
adrian
Posts: 2391

Re: Show namespaces of elements

Thu Nov 13, 2014 1:46 pm

Hi Greg,

You can check the namespace of the element at current cursor position in the Model view (menu > Window > Show View > Model). Note that the Model view is updated dynamically depending on the cursor position, so you can simply click on another element and glance at the Model view to check the namespace.

Oxygen doesn't have a tool that automatically adds/generates namespace prefixes to all elements with unqualified names. However, if there are a few namespaces, you can use the contextual menu (right click) on an element and pick Refactoring > Rename Prefix... to manually add a namespace prefix for all the elements from each of those namespaces.
The Rename prefix dialog shows you the current prefix and namespace in the title bar. Simply introduce the new prefix name (e.g. ns1) and select the option Rename current prefix in all document to add that namespace prefix for all the elements from that namespace found in the document.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Greg
Posts: 2

Re: Show namespaces of elements

Thu Nov 13, 2014 3:43 pm

Thanks Adrian. The technique with the cursor and the model view is just what I was looking for.
Greg Reese

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest