-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement <?xml completion in DTD files #406
Conversation
ArrayList<DTDAttlistDecl> internalDecls = attlist.getInternalChildren(); | ||
if (decl.isDTDAttListDecl()) { | ||
DTDAttlistDecl attlist = (DTDAttlistDecl) decl; | ||
ArrayList<DTDAttlistDecl> internalDecls = attlist.getInternalChildren(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change ArrayList to List
} | ||
} else { | ||
boolean multipleInternalAttlistDecls = false; | ||
ArrayList<DTDDeclParameter> params = attlist.getParameters(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change ArrayList to List
yes please. The basic idea is to use interface and not implementation of collection, list. But problem comes from too DTDDeclNode#getParameters should return List (interface) and not ArrayList (implementation of List). Please change that too. |
Ok, I have made the changes |
private static void addPIToXMLBuilder(DOMNode node, XMLBuilder xml) { | ||
DOMProcessingInstruction processingInstruction = (DOMProcessingInstruction) node; | ||
xml.startPrologOrPI(processingInstruction.getTarget()); | ||
if (processingInstruction.hasAttributes()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A processing instruction will never have attributes, it's always text content (the case below).
@NikolasKomonen I have made the changes. |
@@ -33,7 +34,7 @@ | |||
public DTDDeclParameter unrecognized; // holds all content after parsing goes wrong in a DTD declaration (ENTITY, ATTLIST, ...). | |||
public DTDDeclParameter declType; // represents the actual name of the decl eg: ENTITY, ATTLIST, ... | |||
|
|||
ArrayList<DTDDeclParameter> parameters; | |||
List<DTDDeclParameter> parameters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fbricon changed.
Signed-off-by: David Kwon <[email protected]>
Fixes #267
Previously, the prolog in
.dtd
files were not being parsed by theDOMParser
as aDOMProcessingInstruction
, like.xml
files were.Changing
XMLScanner.java
fixed that. Now that the prolog in.dtd
files are considered to be aDOMProcessingInstruction
, prolog auto-completion now works in.dtd
files.Since
.dtd
files could now contain aDOMProcessingInstruction
in their respectiveDOMDocument
,XMLFormatter.java
had to be changed to take that into account. The "if else" structure inXMLFormatter.java
was also cleaned up.Signed-off-by: David Kwon [email protected]