Skip to content

Commit faac2ee

Browse files
committed
Improved attListDecl handling
1 parent e1b7ce0 commit faac2ee

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/com/maxprograms/xml/XMLOutputter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ public void output(Document sdoc, OutputStream out) throws IOException {
6060
String publicId = sdoc.getPublicId();
6161
String systemId = sdoc.getSystemId();
6262
String internalSubset = sdoc.getInternalSubset();
63-
List<AttributeDecl> customAttributes = sdoc.getAttributes();
64-
if (customAttributes != null) {
63+
64+
List<AttlistDecl> attlistDeclarations = sdoc.getAttlistDeclarations();
65+
if (attlistDeclarations != null && !attlistDeclarations.isEmpty()) {
6566
if (internalSubset == null) {
6667
internalSubset = "";
6768
}
68-
for (int i = 0; i < customAttributes.size(); i++) {
69-
internalSubset = internalSubset + "\n" + customAttributes.get(i);
69+
for (AttlistDecl attlist : attlistDeclarations) {
70+
internalSubset += "\n" + attlist.toString();
7071
}
7172
}
7273
if (publicId != null || systemId != null || internalSubset != null) {

0 commit comments

Comments
 (0)