General XMetaL Discussion
ildark May 18, 2010 at 12:48 pm
XMAX doctype ignores namespace prefixesMay 18, 2010 at 12:48 pmParticipants 3Replies 4Last Activity 12 years, 6 months ago
I'm writing some kind of the Attributes Inspector for XMAX control (6.0) and got a problem with s1000d schemas (compiled into a xac). When I try to get a list of attibute names for an element (through Document.doctype.elementAttributes), it returns list of names without namespace prefixes. For example, 'graphic' element has attributes 'xlink:href' or 'xlink:title', but I got attributes 'href' and 'title' in the list. Also, the schema contains 'dc:title' element, but the method returns attributes for the 'title' element, also defined in the schema.
Validation of the document works well using prefixed attribute and element names.
What I'm doing wrong and is't some way or workaround to get full attribute names for an element?
Thanks.Derek Read May 20, 2010 at 11:30 pm
Reply to: XMAX doctype ignores namespace prefixesMay 20, 2010 at 11:30 pm
For warnings against using the DOMDocumentType object with W3C Schemas please see the topic “DOMDocumentType” in the XMetaL Developer Programmer's Guide.Derek Read May 20, 2010 at 11:58 pm
Reply to: XMAX doctype ignores namespace prefixesMay 20, 2010 at 11:58 pm
You may wonder why we have not attempted to support what you are looking for. Essentially it comes down to the fact that the W3C has never clearly defined this. Please see the following:
DOM 1 (1998): http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-412266927
DOM 2 (2000): http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-412266927
DOM 3 (2004): http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
(same for all links above)
The DocumentType interface in the DOM Core provides an interface to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML schema efforts on DTD representation are not clearly understood as of this writing.ildark May 21, 2010 at 10:59 am
Reply to: XMAX doctype ignores namespace prefixesMay 21, 2010 at 10:59 am
OK, I see. But why you didn't implement it somewhere else? For example, the Selection interface has CanInsertList property to get a list of context-sensitive elements, but has no any CanInsertAttributeList analog. I guess, it's easy for you because you hold entire xml schema with namespaces internally.Derek Read May 21, 2010 at 7:46 pm
Reply to: XMAX doctype ignores namespace prefixesMay 21, 2010 at 7:46 pm
Lack of client demand would be the main factor. Now that we have had a request for something along these lines we may consider adding to the list of APIs clients are looking for, or adding some other feature that helps in a similar way.
- You must be logged in to reply to this topic.