You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2004/01/14 17:08:30 UTC
DO NOT REPLY [Bug 26131] New: -
WFXMLScanner fails for two attributes with same local name but different namespaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26131
WFXMLScanner fails for two attributes with same local name but different namespaces
Summary: WFXMLScanner fails for two attributes with same local
name but different namespaces
Product: Xerces-C++
Version: 2.4.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Non-Validating Parser
AssignedTo: xerces-c-dev@xml.apache.org
ReportedBy: floerke@doctronic.de
If you parse this document
<?xml version="1.0" encoding="iso-8859-1"?>
<x xmlns:a="a" xmlns:b="b">
<y a:driss="aaa" b:driss="aaa"/>
</x>
with WFXMLScanner, it reports the double defined attribute "driss".
This is because within WFXMLScanner.cpp
...
XMLAttr* loopAttr;
for (unsigned int attrIndex=0; attrIndex < attCount; attrIndex++) {
loopAttr = fAttrList->elementAt(attrIndex);
if (curAtt->getURIId() == loopAttr->getURIId() &&
XMLString::equals(curAtt->getName(), loopAttr->getName())) {
emitError
(
XMLErrs::AttrAlreadyUsedInSTag
, curAtt->getName()
, elemDecl->getFullName()
);
}
}
...
all "curAtt->getURIId()" and "loopAttr->curAtt->getURIId()" are the same for all
prefixed or non prefixed attributes. In my opinion there is missing (the same
file, but somewhere above)
...
if (attPrefix && *attPrefix) {
if (XMLString::equals(attPrefix, XMLUni::fgXMLString)) {
curAtt->setURIId(fXMLNamespaceId);
}
...
else {
*** curAtt->setURIId(fElemStack.getPrefixId(attPrefix)); ***
fAttrNSList->addElement(curAtt);
}
...
the "***" marked line. But I am not sure, whether namespace attributes within an
element are processed first, and the namespace will be found on the
element-stack prefixes.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org