Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 60443 Details for
Bug 176416
XML Generation not picking up all available namespaces
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Code to get all xmlns that are defined in an XML document
ProposedNamespaceFix.txt (text/plain), 1.43 KB, created by
David Carver
on 2007-03-08 15:17:04 EST
(
hide
)
Description:
Code to get all xmlns that are defined in an XML document
Filename:
MIME Type:
Creator:
David Carver
Created:
2007-03-08 15:17:04 EST
Size:
1.43 KB
patch
obsolete
>/** > * Retrieve a list of all the namespaces that have been defined with the use of xmlns > * in the schema. This may or may not be more accurate than searching on the XSDImports > * > * @param theXSDSchema > * @param list > */ >public void getAllNamespacesInfo(XSDSchema theXSDSchema, List list) { > org.w3c.dom.Document document = theXSDSchema.getDocument(); > org.w3c.dom.Node rootNode = document.getFirstChild(); > > org.w3c.dom.NamedNodeMap attributeList = rootNode.getAttributes(); > > for (int index = 0; index < attributeList.getLength(); index++) { > org.w3c.dom.Attr attribute = (org.w3c.dom.Attr) attributeList.item(index); > if (attribute.getNamespaceURI() != null) { > if (checkNamespace(list, attribute.getNodeValue()) == false) { > NamespaceInfo info = new NamespaceInfo(); > info.uri = attribute.getNodeValue(); > info.prefix = attribute.getLocalName(); > info.isPrefixRequired = false; > list.add(info); > } > > //info.locationHint = xImport.getSchemaLocation(); > //if (importedXSDSchema != null) { > // info.isPrefixRequired = isPrefixRequired(importedXSDSchema); > //} > } > } >} > >private boolean checkNamespace(List list, String namespace) { > boolean returnSW = false; > for (Iterator iterator = list.iterator(); iterator.hasNext();) { > NamespaceInfo info = (NamespaceInfo) iterator.next(); > if (info.uri.contentEquals(new StringBuffer(namespace))) { > returnSW = true; > } > } > > return returnSW; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 176416
:
60283
|
60443
|
60445
|
60446
|
60460