Skip to content

Commit

Permalink
Use DocumentType#getSystemId() (see #106)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Nov 16, 2018
1 parent fa71b66 commit accc4ce
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,7 @@ public String getSystemId(XMLDocument xmlDocument, String namespaceURI) {
* "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
*/
DocumentType documentType = xmlDocument.getDoctype();
// FIXME!!! get system if correctly with XMLDocument
String content = documentType.getContent();
int lastQuoteIndex = content.lastIndexOf("\"");
if (lastQuoteIndex != -1) {
content = content.substring(0, lastQuoteIndex);
lastQuoteIndex = content.lastIndexOf("\"");
if (lastQuoteIndex != -1) {
return content.substring(lastQuoteIndex + 1, content.length());

}
}
return null;
return documentType.getSystemId();
}

@Override
Expand All @@ -75,7 +64,7 @@ public CMDocument createCMDocument(String key) {
return null;
}
if (model != null) {
// XML Schema can be loaded
//DTD can be loaded
return new DTDDocument(model);
}
return null;
Expand Down

0 comments on commit accc4ce

Please sign in to comment.