diff --git a/src/xid/TagDataCore.java b/src/xid/TagDataCore.java new file mode 100644 index 0000000..8865ed8 --- /dev/null +++ b/src/xid/TagDataCore.java @@ -0,0 +1,18 @@ +package xid; + +import java.util.*; +import java.io.*; + +/* + * Xid uses three class to describe data: + * - TagData + * - TagsData + * - TagsDataById + * Others class that doesn't extends these won't be use by Xid. + * + * This interface helps to express this fact. + * + */ +public interface TagDataCore +{ +} diff --git a/src/xid/TagsDataById.java b/src/xid/TagsDataById.java new file mode 100644 index 0000000..3db8ff7 --- /dev/null +++ b/src/xid/TagsDataById.java @@ -0,0 +1,232 @@ +package xid; + +import java.util.*; +import java.io.*; + +/* + * + */ +public class TagsDataById extends HashMap implements TagDataCore +{ + /** + * + */ + public TagsDataById () + { + super (); + } + + /* + * + */ + public void setId (String id, TagDataCore data) + { + this.put (id, data); + } + + /* + * + */ + public TagDataCore getId (String id) + { + TagDataCore result; + + result = this.get (id); + + // + return (result); + } + + /* ------------------- Helpers ------------ */ + /** + * + */ + public TagData getTagData (String id) + { + TagData result; + + // Be sure that TagData is existing and get item. + result = (TagData) this.get (id); + + if (result == null) + { + this.put (id, new TagData ()); + + result = (TagData) this.get (id); + } + + + // + return (result); + } + + + /** + * + */ + public TagData getTagData (String id, int line) + { + TagData result; + + // Be sure that TagsData are existing. + TagsData tags = (TagsData) this.get (id); + if (tags == null) + { + this.put (id, new TagsData ()); + + tags = (TagsData) this.get (id); + } + + // Be sure that lines are existing. + int nbLines = tags.size (); + for (int nLine = nbLines; nLine < line; nLine++) + { + tags.set (nLine, new TagData ()); + } + + // Get item. + result = (TagData) tags.elementAt (line); + + // + return (result); + } + + + /** + * + */ + public TagData getTagData (String id, int line, String column) + { + TagData result; + + // Be sure that TagsData are existing. + TagsData tags = (TagsData) this.get (id); + if (tags == null) + { + this.put (id, new TagsData ()); + + tags = (TagsData) this.get (id); + } + + // Be sure that lines are existing. + int nbLines = tags.size (); + for (int nLine = nbLines; nLine < line; nLine++) + { + tags.set (nLine, new TagsDataById ()); + } + + // Get item. + TagsDataById lineData = (TagsDataById) tags.elementAt (line); + + result = (TagData) lineData.get (column); + + if (result == null) + { + lineData.put (column, new TagData ()); + + result = (TagData) lineData.get (column); + } + + // + return (result); + } + + + /** + * + */ + public void setContent (String id, String content) + { + TagData tag = this.getTagData (id); + + tag.setContent (content); + } + + + /** + * + */ + public void setContent (String id, int line, String content) + { + TagData tag = this.getTagData (id, line); + + tag.setContent (content); + } + + + /** + * + */ + public void setContent (String id, int line, String column, String content) + { + TagData tag = this.getTagData (id, line, column); + + tag.setContent (content); + } + + + /** + * + */ + public void setAttribute (String id, String label, String value) + { + TagData tag = this.getTagData (id); + + tag.getAttributes ().setAttribute (label, value); + } + + + /** + * + */ + public void setAttribute (String id, int line, String label, String value) + { + TagData tag = this.getTagData (id, line); + + tag.getAttributes ().setAttribute (label, value); + } + + + /** + * + */ + public void setAttribute (String id, int line, String column, String label, String value) + { + TagData tag = this.getTagData (id, line, column); + + tag.getAttributes ().setAttribute (label, value); + } + + + /** + * + */ + public void appendAttribute (String id, String label, String value) + { + TagData tag = this.getTagData (id); + + tag.getAttributes ().appendAttribute (label, value); + } + + + /** + * + */ + public void appendContent (String id, int line, String label, String value) + { + TagData tag = this.getTagData (id, line); + + tag.getAttributes ().appendAttribute (label, value); + } + + + /** + * + */ + public void appendContent (String id, int line, String column, String label, String value) + { + TagData tag = this.getTagData (id, line, column); + + tag.getAttributes ().appendAttribute (label, value); + } +} diff --git a/xhtml-lat1.ent b/xhtml-lat1.ent new file mode 100644 index 0000000..ffee223 --- /dev/null +++ b/xhtml-lat1.ent @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml-special.ent b/xhtml-special.ent new file mode 100644 index 0000000..cead4e8 --- /dev/null +++ b/xhtml-special.ent @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml-symbol.ent b/xhtml-symbol.ent new file mode 100644 index 0000000..63c2abf --- /dev/null +++ b/xhtml-symbol.ent @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml1-frameset.dtd b/xhtml1-frameset.dtd new file mode 100644 index 0000000..1a00936 --- /dev/null +++ b/xhtml1-frameset.dtd @@ -0,0 +1,1235 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xhtml1-transitional.dtd b/xhtml1-transitional.dtd new file mode 100644 index 0000000..e22581b --- /dev/null +++ b/xhtml1-transitional.dtd @@ -0,0 +1,1210 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +