Community
Participate
Working Groups
Create a standard docbook document with additional xlink namespace: <article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> The properties view lists all attributes from the xlink namespace, but without their namespace prefix. These attributes are also added to the document without the prefix, so 'xlink:title' becomes simple 'xlink'. This makes the document invalid. Even if xlink is not yet supported by Vex, attributes namespaces should not be ignored.
After some debugging i found that this is actually an issue with the WTP xml implementation, that simply ignores namespaces for attributes. There is a related open for a long time (Bug 296714). Since there was no activity on this bug for some years, i' m afraid we have to find some kind of workaround in VEX.
Ok, there is a rather crude hack for this. The WTP Api simply ignores attribute namespaces for XSD schemas (it works well with DTD though). A workaround would be to access the base org.eclipse.xsd.XSDAttributeUse direct. String qualifiedName = ""; if (attribute instanceof XSDAttributeUseAdapter) { final XSDAttributeUse xsdAttributeUse = (XSDAttributeUse) ((XSDAttributeUseAdapter) attribute).getKey(); qualifiedName = xsdAttributeUse.getAttributeDeclaration().getQName(); } This is very ugly, so if anybody sees an other way to to this...
Created attachment 232677 [details] Namespace handling for attributes It seems there is no other way than to handle DTD and XSD separately. At least i found a solution that works without adding non-api stuff from WST plugin. I had to add an dependency to org.eclipse.csd though, but this looks like a well documented public api. For me, the properties view looks good with the patch, there is some more work to do for validating attribute values. Please give this patch a try and tell me what you think. I will try to add some tests for attribute namespaces next. I assert that I: 1. authored 100% the content they are contributing 2. have the rights to donate the content to Eclipse 3. contribute the content under the EPL
The implementation looks really good, looking forward to the tests ;-)
Created attachment 232864 [details] Tests for attribute namespace handling
Fixed with commit 5660b2f57675b3bd5428ad749512953299a2107d.
M2 released