Skip to content

Commit d958491

Browse files
authored
Fix documentation auth modules duplicate attributes (#921)
1 parent 826cbff commit d958491

File tree

1 file changed

+9
-3
lines changed
  • openam-documentation/openam-doc-services-ref/src/main/java/org/openidentityplatform/openam/docs/services

1 file changed

+9
-3
lines changed

openam-documentation/openam-doc-services-ref/src/main/java/org/openidentityplatform/openam/docs/services/Generator.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.commons.text.TextStringBuilder;
2020
import org.w3c.dom.Document;
2121
import org.w3c.dom.Element;
22+
import org.w3c.dom.Node;
2223
import org.w3c.dom.NodeList;
2324
import org.xml.sax.InputSource;
2425

@@ -234,9 +235,14 @@ private void generateModuleDoc(Element schemaElement, ResourceBundle bundle, Tex
234235
asciidoc.appendNewLine();
235236

236237
Element orgElement = (Element) schemaElement.getElementsByTagName("Organization").item(0);
237-
NodeList attributes = orgElement.getElementsByTagName("AttributeSchema");
238-
for (int i = 0; i < attributes.getLength(); i++) {
239-
Element attrElement = (Element) attributes.item(i);
238+
NodeList orgChildren = orgElement.getChildNodes();
239+
for (int i = 0; i < orgChildren.getLength(); i++) {
240+
Node node = orgChildren.item(i);
241+
if (node.getNodeType() != Node.ELEMENT_NODE
242+
|| !"AttributeSchema".equals(node.getNodeName())) {
243+
continue;
244+
}
245+
Element attrElement = (Element)node;
240246
printAttributeElement(bundle, asciidoc, attrElement);
241247
}
242248
System.out.printf("generated doc for %s module%n", moduleName);

0 commit comments

Comments
 (0)