String uri = resolveGrammarURI(document, implicitDoctype[0], implicitDoctype[1]);
result.add(new CMDocumentReferenceImpl(implicitDoctype[0], uri));
}
else
{
NamespaceTable namespaceTable = new NamespaceTable(document);
if (node.getNodeType() == Node.ELEMENT_NODE)
{
namespaceTable.addElement((Element)node);
}
if (deep)
{
addChildElementsToNamespaceTable(node, namespaceTable);
}
List list = namespaceTable.getNamespaceInfoList();
for (Iterator i = list.iterator(); i.hasNext();)
{
NamespaceInfo info = (NamespaceInfo) i.next();
String uri = resolveGrammarURI(document, info.uri, info.locationHint);
result.add(new CMDocumentReferenceImpl(info.uri, uri));