You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(46) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
(15) |
Aug
(24) |
Sep
(14) |
Oct
(2) |
Nov
(1) |
Dec
(18) |
2002 |
Jan
(12) |
Feb
(5) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(10) |
Jul
(3) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
(5) |
2003 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(4) |
Jul
(2) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2004 |
Jan
(141) |
Feb
(79) |
Mar
(85) |
Apr
(38) |
May
(1) |
Jun
|
Jul
(78) |
Aug
(223) |
Sep
(107) |
Oct
(158) |
Nov
(136) |
Dec
|
2005 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(100) |
Dec
(22) |
From: Gary L P. <gar...@us...> - 2001-07-25 19:44:44
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory usw-pr-cvs1:/tmp/cvs-serv4049 Modified Files: AttVal.java Clean.java Configuration.java DOMDocumentImpl.java Lexer.java Node.java PPrint.java ParserImpl.java Report.java TagTable.java Tidy.java Log Message: Refactoring to make TagTidy no longer a Singleton. This brings us one step closer to being able to run multiple Tidys inside a JVM. Also refactored Tidy.java so that the main parsing logic appeared only once. |
From: <no...@so...> - 2001-07-25 00:33:17
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Closed Resolution: Later Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Gary L Peskin (garypeskin) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- >Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 17:33 Message: Logged In: YES user_id=91501 No problem. I'll leave this closed. I'm glad your local copy is working. As soon as the Tidy folks release their next version, we'll replicate all of the fixes into JTidy so that we stay in synch. Gary ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-24 17:00 Message: Logged In: YES user_id=279395 I'm using the 04aug2000r6 version of JTidy downloaded from the sourceforge site. The bug report on HTML Tidy #427846 contains a fix. In Lexer.getToken() change if (this.insertspace && mode != IgnoreWhitespace) to if (this.insertspace && ((mode & IgnoreWhitespace) == 0)) There is also a duplicate bug report #431739 which contains an alternative fix. In Parser.parseTag() change if ((node.tag.model & Dict.CM_EMPTY) != 0) { lexer.waswhite = false; return; } else if (!((node.tag.model & Dict.CM_INLINE) != 0)) lexer.insertspace = false; to: if (!((node.tag.model & Dict.CM_INLINE) != 0)) lexer.insertspace = false; if ((node.tag.model & Dict.CM_EMPTY) != 0) { lexer.waswhite = false; return; } It would seem the latter is correct and was adopted in HTML Tidy so this is the fix I used. Sorry my previous message was so unclear. If you need any other help with this let me know. ---------------------------------------------------------------------- Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 09:43 Message: Logged In: YES user_id=91501 What version of JTidy are you on. We had a similar bug and it was also fixed. When you say that you checked on HTML Tidy, do you mean that the bug report was there or the fix was there or what? I want to make sure that this is incorporated into the next release of JTidy. Thanks. ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-25 00:00:45
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Closed Resolution: Later Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Gary L Peskin (garypeskin) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- >Comment By: simon colston (simoncolston) Date: 2001-07-24 17:00 Message: Logged In: YES user_id=279395 I'm using the 04aug2000r6 version of JTidy downloaded from the sourceforge site. The bug report on HTML Tidy #427846 contains a fix. In Lexer.getToken() change if (this.insertspace && mode != IgnoreWhitespace) to if (this.insertspace && ((mode & IgnoreWhitespace) == 0)) There is also a duplicate bug report #431739 which contains an alternative fix. In Parser.parseTag() change if ((node.tag.model & Dict.CM_EMPTY) != 0) { lexer.waswhite = false; return; } else if (!((node.tag.model & Dict.CM_INLINE) != 0)) lexer.insertspace = false; to: if (!((node.tag.model & Dict.CM_INLINE) != 0)) lexer.insertspace = false; if ((node.tag.model & Dict.CM_EMPTY) != 0) { lexer.waswhite = false; return; } It would seem the latter is correct and was adopted in HTML Tidy so this is the fix I used. Sorry my previous message was so unclear. If you need any other help with this let me know. ---------------------------------------------------------------------- Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 09:43 Message: Logged In: YES user_id=91501 What version of JTidy are you on. We had a similar bug and it was also fixed. When you say that you checked on HTML Tidy, do you mean that the bug report was there or the fix was there or what? I want to make sure that this is incorporated into the next release of JTidy. Thanks. ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-24 16:44:53
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Closed >Resolution: Later Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Gary L Peskin (garypeskin) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 09:43 Message: Logged In: YES user_id=91501 What version of JTidy are you on. We had a similar bug and it was also fixed. When you say that you checked on HTML Tidy, do you mean that the bug report was there or the fix was there or what? I want to make sure that this is incorporated into the next release of JTidy. Thanks. ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-24 16:44:13
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Closed Resolution: None Priority: 5 Submitted By: simon colston (simoncolston) >Assigned to: Gary L Peskin (garypeskin) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 09:43 Message: Logged In: YES user_id=91501 What version of JTidy are you on. We had a similar bug and it was also fixed. When you say that you checked on HTML Tidy, do you mean that the bug report was there or the fix was there or what? I want to make sure that this is incorporated into the next release of JTidy. Thanks. ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-24 16:43:52
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Closed Resolution: None Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Nobody/Anonymous (nobody) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- >Comment By: Gary L Peskin (garypeskin) Date: 2001-07-24 09:43 Message: Logged In: YES user_id=91501 What version of JTidy are you on. We had a similar bug and it was also fixed. When you say that you checked on HTML Tidy, do you mean that the bug report was there or the fix was there or what? I want to make sure that this is incorporated into the next release of JTidy. Thanks. ---------------------------------------------------------------------- Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-24 06:43:53
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Nobody/Anonymous (nobody) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- >Comment By: simon colston (simoncolston) Date: 2001-07-23 23:43 Message: Logged In: YES user_id=279395 Sorry. Just checked on HTML Tidy and it's there. Fixed. Added the fix locally. All woking now. Took me 2 days to realize a space was being added because I'm working in Japanese. Sorry for the trouble. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: <no...@so...> - 2001-07-24 06:22:20
|
Bugs item #444003, was opened at 2001-07-23 23:22 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 Category: Tidy functionality Group: None Status: Open Resolution: None Priority: 5 Submitted By: simon colston (simoncolston) Assigned to: Nobody/Anonymous (nobody) Summary: space put in text after inline popped Initial Comment: in Lexer.getToken(short) the following code is causing me a problem when an inline tag e.g. font is inserted from the inline stack. ************************************************** while (true) { c = this.in.readChar(); if (c == StreamIn.EndOfStream) break; if (this.insertspace && mode != IgnoreWhitespace) { addCharToLexer(' '); this.waswhite = true; this.insertspace = false; } *************************************************** the line addCharToLexer(' '); is adding a space at offset 1 into the token, which is a text node. e.g. "[PR]" becomes "[_PR] where '_' is a space. This is a real problem for multibyte character strings as the space is inserted between the two bytes of one character. This only happens after an inline tag has been inserted from the inline stack. Hope this information is useful. I'll look at it a bit more to see if I can see a solution. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=113153&aid=444003&group_id=13153 |
From: Gary L P. <gar...@us...> - 2001-07-23 06:04:23
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory usw-pr-cvs1:/tmp/cvs-serv18616 Modified Files: DOMNodeImpl.java Log Message: Fix bug 418578. Set type of tag from StartEndTag to StartTag and vice-versa when elements are added or removed via the DOM interface regardless of whether the element is an XML element or an HTML element. Index: DOMNodeImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/DOMNodeImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DOMNodeImpl.java 2000/12/10 02:55:16 1.6 +++ DOMNodeImpl.java 2001/07/23 06:04:21 1.7 @@ -246,8 +246,7 @@ } if (refChild == null) { Node.insertNodeAtEnd(this.adaptee, newCh.adaptee); - if (this.adaptee.tag == TagTable.xmlTags - && this.adaptee.type == Node.StartEndTag) { + if (this.adaptee.type == Node.StartEndTag) { this.adaptee.setType(Node.StartTag); } } else { @@ -358,7 +357,6 @@ Node.discardElement(ref); if (this.adaptee.content == null - && this.adaptee.tag == TagTable.xmlTags && this.adaptee.type == Node.StartTag) { this.adaptee.setType(Node.StartEndTag); } @@ -400,7 +398,7 @@ } Node.insertNodeAtEnd(this.adaptee, newCh.adaptee); - if (this.adaptee.tag == TagTable.xmlTags && this.adaptee.type == Node.StartEndTag) { + if (this.adaptee.type == Node.StartEndTag) { this.adaptee.setType(Node.StartTag); } |
From: Gary L P. <gar...@us...> - 2001-07-23 02:11:20
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory usw-pr-cvs1:/tmp/cvs-serv5294 Modified Files: Configuration.java Tidy.java Log Message: Fix bug 435667. A value of "doctype: auto" in the config file was being reported as an error. Also, all config errors were being reported with the invalid option text instead of the name of the option. Fixed to conform to Tidy behavior. Index: Configuration.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Configuration.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Configuration.java 2001/07/22 07:18:02 1.3 +++ Configuration.java 2001/07/23 02:11:17 1.4 @@ -151,131 +151,131 @@ value = _properties.getProperty("indent-spaces"); if (value != null) - spaces = parseInt(value); + spaces = parseInt(value, "indent-spaces"); value = _properties.getProperty("wrap"); if (value != null) - wraplen = parseInt(value); + wraplen = parseInt(value, "wrap"); value = _properties.getProperty("wrap-attributes"); if (value != null) - WrapAttVals = parseBool(value); + WrapAttVals = parseBool(value, "wrap-attributes"); value = _properties.getProperty("wrap-script-literals"); if (value != null) - WrapScriptlets = parseBool(value); + WrapScriptlets = parseBool(value, "wrap-script-literals"); value = _properties.getProperty("wrap-sections"); if (value != null) - WrapSection = parseBool(value); + WrapSection = parseBool(value, "wrap-sections"); value = _properties.getProperty("wrap-asp"); if (value != null) - WrapAsp = parseBool(value); + WrapAsp = parseBool(value, "wrap-asp"); value = _properties.getProperty("wrap-jste"); if (value != null) - WrapJste = parseBool(value); + WrapJste = parseBool(value, "wrap-jste"); value = _properties.getProperty("wrap-php"); if (value != null) - WrapPhp = parseBool(value); + WrapPhp = parseBool(value, "wrap-php"); value = _properties.getProperty("literal-attributes"); if (value != null) - LiteralAttribs = parseBool(value); + LiteralAttribs = parseBool(value, "literal-attributes"); value = _properties.getProperty("tab-size"); if (value != null) - tabsize = parseInt(value); + tabsize = parseInt(value, "tab-size"); value = _properties.getProperty("markup"); if (value != null) - OnlyErrors = parseInvBool(value); + OnlyErrors = parseInvBool(value, "markup"); value = _properties.getProperty("quiet"); if (value != null) - Quiet = parseBool(value); + Quiet = parseBool(value, "quiet"); value = _properties.getProperty("tidy-mark"); if (value != null) - TidyMark = parseBool(value); + TidyMark = parseBool(value, "tidy-mark"); value = _properties.getProperty("indent"); if (value != null) - IndentContent = parseIndent(value); + IndentContent = parseIndent(value, "indent"); value = _properties.getProperty("indent-attributes"); if (value != null) - IndentAttributes = parseBool(value); + IndentAttributes = parseBool(value, "ident-attributes"); value = _properties.getProperty("hide-endtags"); if (value != null) - HideEndTags = parseBool(value); + HideEndTags = parseBool(value, "hide-endtags"); value = _properties.getProperty("input-xml"); if (value != null) - XmlTags = parseBool(value); + XmlTags = parseBool(value, "input-xml"); value = _properties.getProperty("output-xml"); if (value != null) - XmlOut = parseBool(value); + XmlOut = parseBool(value, "output-xml"); value = _properties.getProperty("output-xhtml"); if (value != null) - xHTML = parseBool(value); + xHTML = parseBool(value, "output-xhtml"); value = _properties.getProperty("add-xml-pi"); if (value != null) - XmlPi = parseBool(value); + XmlPi = parseBool(value, "add-xml-pi"); value = _properties.getProperty("add-xml-decl"); if (value != null) - XmlPi = parseBool(value); + XmlPi = parseBool(value, "add-xml-decl"); value = _properties.getProperty("assume-xml-procins"); if (value != null) - XmlPIs = parseBool(value); + XmlPIs = parseBool(value, "assume-xml-procins"); value = _properties.getProperty("raw"); if (value != null) - RawOut = parseBool(value); + RawOut = parseBool(value, "raw"); value = _properties.getProperty("uppercase-tags"); if (value != null) - UpperCaseTags = parseBool(value); + UpperCaseTags = parseBool(value, "uppercase-tags"); value = _properties.getProperty("uppercase-attributes"); if (value != null) - UpperCaseAttrs = parseBool(value); + UpperCaseAttrs = parseBool(value, "uppercase-attributes"); value = _properties.getProperty("clean"); if (value != null) - MakeClean = parseBool(value); + MakeClean = parseBool(value, "clean"); value = _properties.getProperty("logical-emphasis"); if (value != null) - LogicalEmphasis = parseBool(value); + LogicalEmphasis = parseBool(value, "logical-emphasis"); value = _properties.getProperty("word-2000"); if (value != null) - Word2000 = parseBool(value); + Word2000 = parseBool(value, "word-2000"); value = _properties.getProperty("drop-empty-paras"); if (value != null) - DropEmptyParas = parseBool(value); + DropEmptyParas = parseBool(value, "drop-empty-paras"); value = _properties.getProperty("drop-font-tags"); if (value != null) - DropFontTags = parseBool(value); + DropFontTags = parseBool(value, "drop-font-tags"); value = _properties.getProperty("enclose-text"); if (value != null) - EncloseBodyText = parseBool(value); + EncloseBodyText = parseBool(value, "enclose-text"); value = _properties.getProperty("enclose-block-text"); if (value != null) - EncloseBlockText = parseBool(value); + EncloseBlockText = parseBool(value, "enclose-block-text"); value = _properties.getProperty("alt-text"); if (value != null) @@ -283,87 +283,87 @@ value = _properties.getProperty("add-xml-space"); if (value != null) - XmlSpace = parseBool(value); + XmlSpace = parseBool(value, "add-xml-space"); value = _properties.getProperty("fix-bad-comments"); if (value != null) - FixComments = parseBool(value); + FixComments = parseBool(value, "fix-bad-comments"); value = _properties.getProperty("split"); if (value != null) - BurstSlides = parseBool(value); + BurstSlides = parseBool(value, "split"); value = _properties.getProperty("break-before-br"); if (value != null) - BreakBeforeBR = parseBool(value); + BreakBeforeBR = parseBool(value, "break-before-br"); value = _properties.getProperty("numeric-entities"); if (value != null) - NumEntities = parseBool(value); + NumEntities = parseBool(value, "numeric-entities"); value = _properties.getProperty("quote-marks"); if (value != null) - QuoteMarks = parseBool(value); + QuoteMarks = parseBool(value, "quote-marks"); value = _properties.getProperty("quote-nbsp"); if (value != null) - QuoteNbsp = parseBool(value); + QuoteNbsp = parseBool(value, "quote-nbsp"); value = _properties.getProperty("quote-ampersand"); if (value != null) - QuoteAmpersand = parseBool(value); + QuoteAmpersand = parseBool(value, "quote-ampersand"); value = _properties.getProperty("write-back"); if (value != null) - writeback = parseBool(value); + writeback = parseBool(value, "write-back"); value = _properties.getProperty("keep-time"); if (value != null) - KeepFileTimes = parseBool(value); + KeepFileTimes = parseBool(value, "keep-time"); value = _properties.getProperty("show-warnings"); if (value != null) - ShowWarnings = parseBool(value); + ShowWarnings = parseBool(value, "show-warnings"); value = _properties.getProperty("error-file"); if (value != null) - errfile = parseName(value); + errfile = parseName(value, "error-file"); value = _properties.getProperty("slide-style"); if (value != null) - slidestyle = parseName(value); + slidestyle = parseName(value, "slide-style"); value = _properties.getProperty("new-inline-tags"); if (value != null) - parseInlineTagNames(value); + parseInlineTagNames(value, "new-inline-tags"); value = _properties.getProperty("new-blocklevel-tags"); if (value != null) - parseBlockTagNames(value); + parseBlockTagNames(value, "new-blocklevel-tags"); value = _properties.getProperty("new-empty-tags"); if (value != null) - parseEmptyTagNames(value); + parseEmptyTagNames(value, "new-empty-tags"); value = _properties.getProperty("new-pre-tags"); if (value != null) - parsePreTagNames(value); + parsePreTagNames(value, "new-pre-tags"); value = _properties.getProperty("char-encoding"); if (value != null) - CharEncoding = parseCharEncoding(value); + CharEncoding = parseCharEncoding(value, "char-encoding"); value = _properties.getProperty("doctype"); if (value != null) - docTypeStr = parseDocType(value); + docTypeStr = parseDocType(value, "doctype"); value = _properties.getProperty("fix-backslash"); if (value != null) - FixBackslash = parseBool(value); + FixBackslash = parseBool(value, "fix-backslash"); value = _properties.getProperty("gnu-emacs"); if (value != null) - Emacs = parseBool(value); + Emacs = parseBool(value, "gnu-emacs"); } /* ensure that config is self consistent */ @@ -410,20 +410,20 @@ } } - private static int parseInt( String s ) + private static int parseInt( String s, String option ) { int i = 0; try { i = Integer.parseInt( s ); } catch ( NumberFormatException e ) { - Report.badArgument(s); + Report.badArgument(option); i = -1; } return i; } - private static boolean parseBool( String s ) + private static boolean parseBool( String s, String option ) { boolean b = false; if ( s != null && s.length() > 0 ) { @@ -433,12 +433,12 @@ else if ((c == 'f') || (c == 'F') || (c == 'N') || (c == 'n') || (c == '0')) b = false; else - Report.badArgument(s); + Report.badArgument(option); } return b; } - private static boolean parseInvBool( String s ) + private static boolean parseInvBool( String s, String option ) { boolean b = false; if ( s != null && s.length() > 0 ) { @@ -448,23 +448,23 @@ else if ((c == 'f') || (c == 'F') || (c == 'N') || (c == 'n')) b = false; else - Report.badArgument(s); + Report.badArgument(option); } return !b; } - private static String parseName( String s ) + private static String parseName( String s, String option ) { StringTokenizer t = new StringTokenizer( s ); String rs = null; if ( t.countTokens() >= 1 ) rs = t.nextToken(); else - Report.badArgument(s); + Report.badArgument(option); return rs; } - private static int parseCharEncoding( String s ) + private static int parseCharEncoding( String s, String option ) { int result = ASCII; @@ -481,13 +481,13 @@ else if (Lexer.wstrcasecmp(s, "mac") == 0) result = MACROMAN; else - Report.badArgument(s); + Report.badArgument(option); return result; } /* slight hack to avoid changes to pprint.c */ - private boolean parseIndent( String s ) + private boolean parseIndent( String s, String option ) { boolean b = IndentContent; @@ -517,11 +517,11 @@ SmartIndent = true; } else - Report.badArgument(s); + Report.badArgument(option); return b; } - private static void parseInlineTagNames( String s ) + private static void parseInlineTagNames( String s, String option ) { StringTokenizer t = new StringTokenizer( s, " \t\n\r," ); while ( t.hasMoreTokens() ) { @@ -529,7 +529,7 @@ } } - private static void parseBlockTagNames( String s ) + private static void parseBlockTagNames( String s, String option ) { StringTokenizer t = new StringTokenizer( s, " \t\n\r," ); while ( t.hasMoreTokens() ) { @@ -537,7 +537,7 @@ } } - private static void parseEmptyTagNames( String s ) + private static void parseEmptyTagNames( String s, String option ) { StringTokenizer t = new StringTokenizer( s, " \t\n\r," ); while ( t.hasMoreTokens() ) { @@ -545,7 +545,7 @@ } } - private static void parsePreTagNames( String s ) + private static void parsePreTagNames( String s, String option ) { StringTokenizer t = new StringTokenizer( s, " \t\n\r," ); while ( t.hasMoreTokens() ) { @@ -560,7 +560,7 @@ "-//ACME//DTD HTML 3.14159//EN" */ - protected String parseDocType(String s) + protected String parseDocType( String s, String option ) { s = s.trim(); @@ -578,8 +578,6 @@ if (t.hasMoreTokens()) word = t.nextToken(); - docTypeMode = DOCTYPE_AUTO; - if (Lexer.wstrcasecmp(word, "omit") == 0) docTypeMode = DOCTYPE_OMIT; else if (Lexer.wstrcasecmp(word, "strict") == 0) @@ -587,8 +585,13 @@ else if (Lexer.wstrcasecmp(word, "loose") == 0 || Lexer.wstrcasecmp(word, "transitional") == 0) docTypeMode = DOCTYPE_LOOSE; + else if (Lexer.wstrcasecmp(word, "auto") == 0) + docTypeMode = DOCTYPE_AUTO; else - Report.badArgument(s); + { + docTypeMode = DOCTYPE_AUTO; + Report.badArgument(option); + } return null; } Index: Tidy.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Tidy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Tidy.java 2001/07/22 07:18:02 1.2 +++ Tidy.java 2001/07/23 02:11:17 1.3 @@ -817,7 +817,7 @@ public void setDocType(String doctype) { if (doctype != null) - configuration.docTypeStr = configuration.parseDocType(doctype); + configuration.docTypeStr = configuration.parseDocType(doctype, "doctype"); } public String getDocType() |
From: Gary L P. <gar...@us...> - 2001-07-23 00:32:54
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory usw-pr-cvs1:/tmp/cvs-serv18304 Modified Files: Node.java Log Message: Fix bug 228486 where a text node was getting created improperly. The text node was designed to "steal" a textarray slot from the sibling element immediately to its right in the parse tree. However, that element had no slots to steal so the fix allocates a new one byte text array and uses that instead. Index: Node.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Node.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Node.java 2001/07/22 07:18:02 1.5 +++ Node.java 2001/07/23 00:32:51 1.6 @@ -471,9 +471,23 @@ else /* create new node */ { node = lexer.newNode(); - node.start = element.start++; - node.end = element.start; - node.textarray = element.textarray; + // Local fix for bug 228486 (GLP). This handles the case + // where we need to create a preceeding text node but there are + // no "slots" in textarray that we can steal from the current + // element. Therefore, we create a new textarray containing + // just the blank. When Tidy is fixed, this should be removed. + if (element.start >= element.end) + { + node.start = 0; + node.end = 1; + node.textarray = new byte[1]; + } + else + { + node.start = element.start++; + node.end = element.start; + node.textarray = element.textarray; + } node.textarray[node.start] = (byte)' '; node.prev = prev; if (prev != null) |
From: Gary L P. <gar...@us...> - 2001-07-22 07:18:05
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory usw-pr-cvs1:/tmp/cvs-serv18350 Modified Files: AttVal.java Clean.java Configuration.java Lexer.java Node.java ParserImpl.java Tidy.java Log Message: Fix bug 443232 and removed unnecessary instances of String creation. Index: AttVal.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/AttVal.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- AttVal.java 2000/10/30 14:21:17 1.1.1.1 +++ AttVal.java 2001/07/22 07:18:02 1.2 @@ -83,9 +83,9 @@ av.next = (AttVal)next.clone(); } if (attribute != null) - av.attribute = new String(attribute); + av.attribute = attribute; if (value != null) - av.value = new String(value); + av.value = value; av.delim = delim; if (asp != null) { av.asp = (Node)asp.clone(); Index: Clean.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Clean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Clean.java 2000/11/21 19:08:11 1.2 +++ Clean.java 2001/07/22 07:18:02 1.3 @@ -94,7 +94,7 @@ { /* insert before this */ - prop = new StyleProp(new String(name), new String(value), props); + prop = new StyleProp(name, value, props); if (prev != null) prev.next = prop; @@ -108,7 +108,7 @@ props = props.next; } - prop = new StyleProp(new String(name), new String(value)); + prop = new StyleProp(name, value); if (prev != null) prev.next = prop; @@ -253,8 +253,7 @@ return style.tagClass; } - style = new Style(new String(tag), gensymClass(tag), - new String(properties), lexer.styles); + style = new Style(tag, gensymClass(tag), properties, lexer.styles); lexer.styles = style; return style.tagClass; } @@ -437,13 +436,11 @@ if (lexer.styles == null && niceBody(lexer, doc)) return; - node = lexer.newNode(Node.StartTag, null, 0, 0, new String("style")); + node = lexer.newNode(Node.StartTag, null, 0, 0, "style"); node.implicit = true; /* insert type attribute */ - av = new AttVal(null, null, '"', - new String("type"), - new String("text/css")); + av = new AttVal(null, null, '"', "type", "text/css"); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); node.attributes = av; @@ -599,9 +596,7 @@ } else /* else create new style attribute */ { - av = new AttVal(node.attributes, null, '"', - new String("style"), - new String(property)); + av = new AttVal(node.attributes, null, '"', "style", property); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); node.attributes = av; } @@ -660,9 +655,7 @@ } else if (s2 != null) /* copy style of child */ { - av = new AttVal(node.attributes, null, '"', - new String("style"), - new String(s2)); + av = new AttVal(node.attributes, null, '"', "style", s2); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); node.attributes = av; } @@ -673,13 +666,13 @@ /* String[] sizes = { - new String("50%"), - new String("60%"), - new String("80%"), + "50%", + "60%", + "80%", null, - new String("120%"), - new String("150%"), - new String("200%") + "120%", + "150%", + "200%" }; */ @@ -751,21 +744,21 @@ if (size.equals("6") && node.tag == TagTable.tagP) { - node.element = new String("h1"); + node.element = "h1"; TagTable.getDefaultTagTable().findTag(node); return; } if (size.equals("5") && node.tag == TagTable.tagP) { - node.element = new String("h2"); + node.element = "h2"; TagTable.getDefaultTagTable().findTag(node); return; } if (size.equals("4") && node.tag == TagTable.tagP) { - node.element = new String("h3"); + node.element = "h3"; TagTable.getDefaultTagTable().findTag(node); return; } @@ -876,7 +869,7 @@ /* coerce dir to div */ node.tag = TagTable.tagDiv; - node.element = new String("div"); + node.element = "div"; addStyleProperty(node, "margin-left: 2em"); stripOnlyChild(node); return true; @@ -975,7 +968,7 @@ return true; } node.tag = TagTable.tagDiv; - node.element = new String("div"); + node.element = "div"; addStyleProperty(node, "text-align: center"); return true; } @@ -1254,7 +1247,7 @@ node.attributes = style; node.tag = TagTable.tagSpan; - node.element = new String("span"); + node.element = "span"; return true; } @@ -1393,12 +1386,12 @@ { if (node.tag == TagTable.tagI) { - node.element = new String(TagTable.tagEm.name); + node.element = TagTable.tagEm.name; node.tag = TagTable.tagEm; } else if (node.tag == TagTable.tagB) { - node.element = new String(TagTable.tagStrong.name); + node.element = TagTable.tagStrong.name; node.tag = TagTable.tagStrong; } @@ -1427,7 +1420,7 @@ node.hasOneChild() && node.content.implicit) { stripOnlyChild(node); - node.element = new String(TagTable.tagBlockquote.name); + node.element = TagTable.tagBlockquote.name; node.tag = TagTable.tagBlockquote; node.implicit = true; } @@ -1466,7 +1459,7 @@ indent_buf = "margin-left: " + (new Integer(2*indent)).toString() + "em"; - node.element = new String(TagTable.tagDiv.name); + node.element = TagTable.tagDiv.name; node.tag = TagTable.tagDiv; node.addAttribute("style", indent_buf); } Index: Configuration.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Configuration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Configuration.java 2000/11/01 08:32:20 1.2 +++ Configuration.java 2001/07/22 07:18:02 1.3 @@ -279,7 +279,7 @@ value = _properties.getProperty("alt-text"); if (value != null) - altText = new String(value); + altText = value; value = _properties.getProperty("add-xml-space"); if (value != null) Index: Lexer.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Lexer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Lexer.java 2000/12/20 21:54:58 1.4 +++ Lexer.java 2001/07/22 07:18:02 1.5 @@ -698,13 +698,13 @@ if (!attr.value.equals(profile)) { Report.warning(this, node, null, Report.INCONSISTENT_NAMESPACE); - attr.value = new String(profile); + attr.value = profile; } } else { attr = new AttVal( node.attributes, null, (int)'"', - "xmlns", new String( profile ) ); + "xmlns", profile ); attr.dict = AttributeTable.getDefaultAttributeTable().findAttribute( attr ); node.attributes = attr; @@ -1051,7 +1051,7 @@ this.lexbuf, this.txtstart, this.txtend, - new String(name)); + name); node.implicit = true; return node; } @@ -2696,7 +2696,7 @@ // make sure there is enough space for the stack is = new IStack(); is.tag = node.tag; - is.element = new String( node.element ); + is.element = node.element; if (node.attributes != null) is.attributes = cloneAttributes(node.attributes); this.istack.push( is ); @@ -2814,7 +2814,7 @@ // is fixed in istack.c in the original Tidy node.implicit = true; is = (IStack)this.istack.elementAt( this.insert ); - node.element = new String( is.element ); + node.element = is.element; node.tag = is.tag; if (is.attributes != null) node.attributes = cloneAttributes(is.attributes); Index: Node.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Node.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Node.java 2000/11/30 21:27:03 1.4 +++ Node.java 2001/07/22 07:18:02 1.5 @@ -147,7 +147,7 @@ node.was = this.was; node.tag = this.tag; if (this.element != null) - node.element = new String(this.element); + node.element = this.element; if (this.attributes != null) node.attributes = (AttVal)this.attributes.clone(); return node; @@ -190,7 +190,7 @@ public void addAttribute(String name, String value) { AttVal av = new AttVal(null, null, null, null, - '"', new String(name), new String(value)); + '"', name, value); av.dict = AttributeTable.getDefaultAttributeTable().findAttribute(av); @@ -643,7 +643,7 @@ node.tag = tag; node.type = StartTag; node.implicit = true; - node.element = new String(tag.name); + node.element = tag.name; } /* extract a node and its children from a markup tree */ Index: ParserImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/ParserImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ParserImpl.java 2000/12/21 22:00:03 1.2 +++ ParserImpl.java 2001/07/22 07:18:02 1.3 @@ -939,7 +939,7 @@ element.isDescendantOf(TagTable.tagDt))) { node.tag = TagTable.tagBr; - node.element = new String("br"); + node.element = "br"; Node.trimSpaces(lexer, element); Node.insertNodeAtEnd(element, node); continue; Index: Tidy.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Tidy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Tidy.java 2000/10/30 14:21:40 1.1.1.1 +++ Tidy.java 2001/07/22 07:18:02 1.2 @@ -1366,8 +1366,7 @@ { if (argc >= 3) { - configuration.errfile = - new String(argv[argIndex + 1]); + configuration.errfile = argv[argIndex + 1]; --argc; ++argIndex; } |
Update of /cvsroot/jtidy/jtidy/src/org/w3c/dom In directory usw-pr-cvs1:/tmp/cvs-serv7424 Modified Files: Attr.java CDATASection.java CharacterData.java Comment.java DOMException.java DOMImplementation.java Document.java DocumentFragment.java DocumentType.java Element.java Entity.java EntityReference.java NamedNodeMap.java Node.java NodeList.java Notation.java ProcessingInstruction.java Text.java Log Message: Use DOM2 java bindings from W3C. Index: Attr.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/Attr.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Attr.java 2000/10/30 14:21:13 1.1.1.1 +++ Attr.java 2001/06/15 13:52:36 1.2 @@ -1,105 +1,111 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * The <code>Attr</code> interface represents an attribute in an - * <code>Element</code> object. Typically the allowable values for the - * attribute are defined in a document type definition. - * <p><code>Attr</code> objects inherit the <code>Node</code> interface, but - * since they are not actually child nodes of the element they describe, the - * DOM does not consider them part of the document tree. Thus, the - * <code>Node</code> attributes <code>parentNode</code> , - * <code>previousSibling</code> , and <code>nextSibling</code> have a - * <code>null</code> value for <code>Attr</code> objects. The DOM takes the - * view that attributes are properties of elements rather than having a - * separate identity from the elements they are associated with; this should - * make it more efficient to implement such features as default attributes - * associated with all elements of a given type. Furthermore, - * <code>Attr</code> nodes may not be immediate children of a - * <code>DocumentFragment</code> . However, they can be associated with - * <code>Element</code> nodes contained within a <code>DocumentFragment</code> - * . In short, users and implementors of the DOM need to be aware that - * <code>Attr</code> nodes have some things in common with other objects - * inheriting the <code>Node</code> interface, but they also are quite - * distinct. - * <p> The attribute's effective value is determined as follows: if this - * attribute has been explicitly assigned any value, that value is the - * attribute's effective value; otherwise, if there is a declaration for - * this attribute, and that declaration includes a default value, then that - * default value is the attribute's effective value; otherwise, the - * attribute does not exist on this element in the structure model until it - * has been explicitly added. Note that the <code>nodeValue</code> - * attribute on the <code>Attr</code> instance can also be used to retrieve - * the string version of the attribute's value(s). - * <p> In XML, where the value of an attribute can contain entity references, - * the child nodes of the <code>Attr</code> node provide a representation in - * which entity references are not expanded. These child nodes may be either - * <code>Text</code> or <code>EntityReference</code> nodes. Because the - * attribute type may be unknown, there are no tokenized attribute values. - */ -public interface Attr extends Node { - /** - * Returns the name of this attribute. - */ - public String getName(); - - /** - * If this attribute was explicitly given a value in the original - * document, this is <code>true</code> ; otherwise, it is - * <code>false</code> . Note that the implementation is in charge of this - * attribute, not the user. If the user changes the value of the - * attribute (even if it ends up having the same value as the default - * value) then the <code>specified</code> flag is automatically flipped - * to <code>true</code> . To re-specify the attribute as the default - * value from the DTD, the user must delete the attribute. The - * implementation will then make a new attribute available with - * <code>specified</code> set to <code>false</code> and the default value - * (if one exists). - * <br> In summary: If the attribute has an assigned value in the document - * then <code>specified</code> is <code>true</code> , and the value is - * the assigned value. If the attribute has no assigned value in the - * document and has a default value in the DTD, then - * <code>specified</code> is <code>false</code> , and the value is the - * default value in the DTD. If the attribute has no assigned value in - * the document and has a value of #IMPLIED in the DTD, then the - * attribute does not appear in the structure model of the document. - */ - public boolean getSpecified(); - - /** - * On retrieval, the value of the attribute is returned as a string. - * Character and general entity references are replaced with their - * values. See also the method <code>getAttribute</code> on the - * <code>Element</code> interface. - * <br> On setting, this creates a <code>Text</code> node with the unparsed - * contents of the string. I.e. any characters that an XML processor - * would recognize as markup are instead treated as literal text. See - * also the method <code>setAttribute</code> on the <code>Element</code> - * interface. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. - */ - public String getValue(); - public void setValue(String value) - throws DOMException; - - /** - * The <code>Element</code> node this attribute is attached to or - * <code>null</code> if this attribute is not in use. - * @since DOM Level 2 - */ - public Element getOwnerElement(); - -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * The <code>Attr</code> interface represents an attribute in an + * <code>Element</code> object. Typically the allowable values for the + * attribute are defined in a document type definition. + * <p><code>Attr</code> objects inherit the <code>Node</code> interface, but + * since they are not actually child nodes of the element they describe, the + * DOM does not consider them part of the document tree. Thus, the + * <code>Node</code> attributes <code>parentNode</code>, + * <code>previousSibling</code>, and <code>nextSibling</code> have a + * <code>null</code> value for <code>Attr</code> objects. The DOM takes the + * view that attributes are properties of elements rather than having a + * separate identity from the elements they are associated with; this should + * make it more efficient to implement such features as default attributes + * associated with all elements of a given type. Furthermore, + * <code>Attr</code> nodes may not be immediate children of a + * <code>DocumentFragment</code>. However, they can be associated with + * <code>Element</code> nodes contained within a + * <code>DocumentFragment</code>. In short, users and implementors of the + * DOM need to be aware that <code>Attr</code> nodes have some things in + * common with other objects inheriting the <code>Node</code> interface, but + * they also are quite distinct. + * <p> The attribute's effective value is determined as follows: if this + * attribute has been explicitly assigned any value, that value is the + * attribute's effective value; otherwise, if there is a declaration for + * this attribute, and that declaration includes a default value, then that + * default value is the attribute's effective value; otherwise, the + * attribute does not exist on this element in the structure model until it + * has been explicitly added. Note that the <code>nodeValue</code> attribute + * on the <code>Attr</code> instance can also be used to retrieve the string + * version of the attribute's value(s). + * <p>In XML, where the value of an attribute can contain entity references, + * the child nodes of the <code>Attr</code> node may be either + * <code>Text</code> or <code>EntityReference</code> nodes (when these are + * in use; see the description of <code>EntityReference</code> for + * discussion). Because the DOM Core is not aware of attribute types, it + * treats all attribute values as simple strings, even if the DTD or schema + * declares them as having tokenized types. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public interface Attr extends Node { + /** + * Returns the name of this attribute. + */ + public String getName(); + + /** + * If this attribute was explicitly given a value in the original + * document, this is <code>true</code>; otherwise, it is + * <code>false</code>. Note that the implementation is in charge of this + * attribute, not the user. If the user changes the value of the + * attribute (even if it ends up having the same value as the default + * value) then the <code>specified</code> flag is automatically flipped + * to <code>true</code>. To re-specify the attribute as the default + * value from the DTD, the user must delete the attribute. The + * implementation will then make a new attribute available with + * <code>specified</code> set to <code>false</code> and the default + * value (if one exists). + * <br>In summary: If the attribute has an assigned value in the document + * then <code>specified</code> is <code>true</code>, and the value is + * the assigned value. If the attribute has no assigned value in the + * document and has a default value in the DTD, then + * <code>specified</code> is <code>false</code>, and the value is the + * default value in the DTD. If the attribute has no assigned value in + * the document and has a value of #IMPLIED in the DTD, then the + * attribute does not appear in the structure model of the document. If + * the <code>ownerElement</code> attribute is <code>null</code> (i.e. + * because it was just created or was set to <code>null</code> by the + * various removal and cloning operations) <code>specified</code> is + * <code>true</code>. + */ + public boolean getSpecified(); + + /** + * On retrieval, the value of the attribute is returned as a string. + * Character and general entity references are replaced with their + * values. See also the method <code>getAttribute</code> on the + * <code>Element</code> interface. + * <br>On setting, this creates a <code>Text</code> node with the unparsed + * contents of the string. I.e. any characters that an XML processor + * would recognize as markup are instead treated as literal text. See + * also the method <code>setAttribute</code> on the <code>Element</code> + * interface. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. + */ + public String getValue(); + public void setValue(String value) + throws DOMException; + + /** + * The <code>Element</code> node this attribute is attached to or + * <code>null</code> if this attribute is not in use. + * @since DOM Level 2 + */ + public Element getOwnerElement(); + +} Index: CDATASection.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/CDATASection.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- CDATASection.java 2000/10/30 14:21:14 1.1.1.1 +++ CDATASection.java 2001/06/15 13:52:36 1.2 @@ -1,48 +1,48 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * CDATA sections are used to escape blocks of text containing characters - * that would otherwise be regarded as markup. The only delimiter that is - * recognized in a CDATA section is the "]]>" string that ends the CDATA - * section. CDATA sections cannot be nested. Their primary purpose is for - * including material such as XML fragments, without needing to escape all - * the delimiters. - * <p> The <code>DOMString</code> attribute of the <code>Text</code> node - * holds the text that is contained by the CDATA section. Note that this may - * contain characters that need to be escaped outside of CDATA sections and - * that, depending on the character encoding ("charset") chosen for - * serialization, it may be impossible to write out some characters as part - * of a CDATA section. - * <p> The <code>CDATASection</code> interface inherits from the - * <code>CharacterData</code> interface through the <code>Text</code> - * interface. Adjacent <code>CDATASections</code> nodes are not merged by use - * of the <code>normalize</code> method of the <code>Element</code> interface. - * Because no markup is recognized within a <code>CDATASection</code> , - * character numeric references cannot be used as an escape mechanism when - * serializing. Therefore, action needs to be taken when serializing a - * <code>CDATASection</code> with a character encoding where some of the - * contained characters cannot be represented. Failure to do so would not - * produce well-formed XML. One potential solution in the serialization - * process is to end the CDATA section before the character, output the - * character using a character reference or entity reference, and open a new - * CDATA section for any further characters in the text node. Note, however, - * that some code conversion libraries at the time of writing do not return - * an error or exception when a character is missing from the encoding, - * making the task of ensuring that data is not corrupted on serialization - * more difficult. - */ -public interface CDATASection extends Text { -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * CDATA sections are used to escape blocks of text containing characters that + * would otherwise be regarded as markup. The only delimiter that is + * recognized in a CDATA section is the "]]>" string that ends the CDATA + * section. CDATA sections cannot be nested. Their primary purpose is for + * including material such as XML fragments, without needing to escape all + * the delimiters. + * <p>The <code>DOMString</code> attribute of the <code>Text</code> node holds + * the text that is contained by the CDATA section. Note that this may + * contain characters that need to be escaped outside of CDATA sections and + * that, depending on the character encoding ("charset") chosen for + * serialization, it may be impossible to write out some characters as part + * of a CDATA section. + * <p> The <code>CDATASection</code> interface inherits from the + * <code>CharacterData</code> interface through the <code>Text</code> + * interface. Adjacent <code>CDATASection</code> nodes are not merged by use + * of the <code>normalize</code> method of the <code>Node</code> interface. + * Because no markup is recognized within a <code>CDATASection</code>, + * character numeric references cannot be used as an escape mechanism when + * serializing. Therefore, action needs to be taken when serializing a + * <code>CDATASection</code> with a character encoding where some of the + * contained characters cannot be represented. Failure to do so would not + * produce well-formed XML.One potential solution in the serialization + * process is to end the CDATA section before the character, output the + * character using a character reference or entity reference, and open a new + * CDATA section for any further characters in the text node. Note, however, + * that some code conversion libraries at the time of writing do not return + * an error or exception when a character is missing from the encoding, + * making the task of ensuring that data is not corrupted on serialization + * more difficult. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public interface CDATASection extends Text { +} Index: CharacterData.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/CharacterData.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- CharacterData.java 2000/10/30 14:21:14 1.1.1.1 +++ CharacterData.java 2001/06/15 13:52:36 1.2 @@ -1,145 +1,144 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * The <code>CharacterData</code> interface extends Node with a set of - * attributes and methods for accessing character data in the DOM. For - * clarity this set is defined here rather than on each object that uses - * these attributes and methods. No DOM objects correspond directly to - * <code>CharacterData</code> , though <code>Text</code> and others do - * inherit the interface from it. All <code>offsets</code> in this interface - * start from 0. - * <p> As explained in the <code>DOMString</code> interface, text strings in - * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In - * the following, the term 16-bit units is used whenever necessary to - * indicate that indexing on CharacterData is done in 16-bit units. - */ -public interface CharacterData extends Node { - /** - * The character data of the node that implements this interface. The DOM - * implementation may not put arbitrary limits on the amount of data that - * may be stored in a <code>CharacterData</code> node. However, - * implementation limits may mean that the entirety of a node's data may - * not fit into a single <code>DOMString</code> . In such cases, the user - * may call <code>substringData</code> to retrieve the data in - * appropriately sized pieces. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. - * @exception DOMException - * DOMSTRING_SIZE_ERR: Raised when it would return more characters - * than fit in a <code>DOMString</code> variable on the implementation - * platform. - */ - public String getData() - throws DOMException; - public void setData(String data) - throws DOMException; - - /** - * The number of 16-bit units that are available through - * <code>data</code> and the <code>substringData</code> method below. - * This may have the value zero, i.e., <code>CharacterData</code> nodes - * may be empty. - */ - public int getLength(); - - /** - * Extracts a range of data from the node. - * @param offset Start offset of substring to extract. - * @param count The number of 16-bit units to extract. - * @return The specified substring. If the sum of <code>offset</code> and - * <code>count</code> exceeds the <code>length</code> , then all 16-bit - * units to the end of the data are returned. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is - * negative or greater than the number of 16-bit units in - * <code>data</code> , or if the specified <code>count</code> is - * negative. - * <br> DOMSTRING_SIZE_ERR: Raised if the specified range of text does - * not fit into a <code>DOMString</code> . - */ - public String substringData(int offset, - int count) - throws DOMException; - - /** - * Append the string to the end of the character data of the node. Upon - * success, <code>data</code> provides access to the concatenation of - * <code>data</code> and the <code>DOMString</code> specified. - * @param arg The <code>DOMString</code> to append. - * @exception DOMException - * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. - */ - public void appendData(String arg) - throws DOMException; - - /** - * Insert a string at the specified character offset. - * @param offset The character offset at which to insert. - * @param arg The <code>DOMString</code> to insert. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is - * negative or greater than the number of 16-bit units in - * <code>data</code> . - * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. - */ - public void insertData(int offset, - String arg) - throws DOMException; - - /** - * Remove a range of 16-bit units from the node. Upon success, - * <code>data</code> and <code>length</code> reflect the change. - * @param offset The offset from which to start removing. - * @param count The number of 16-bit units to delete. If the sum of - * <code>offset</code> and <code>count</code> exceeds - * <code>length</code> then all 16-bit units from <code>offset</code> - * to the end of the data are deleted. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is - * negative or greater than the number of 16-bit units in - * <code>data</code> , or if the specified <code>count</code> is - * negative. - * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. - */ - public void deleteData(int offset, - int count) - throws DOMException; - - /** - * Replace the characters starting at the specified 16-bit unit offset - * with the specified string. - * @param offset The offset from which to start replacing. - * @param count The number of 16-bit units to replace. If the sum of - * <code>offset</code> and <code>count</code> exceeds - * <code>length</code> , then all 16-bit units to the end of the data - * are replaced; (i.e., the effect is the same as a <code>remove</code> - * method call with the same range, followed by an <code>append</code> - * method invocation). - * @param arg The <code>DOMString</code> with which the range must be - * replaced. - * @exception DOMException - * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is - * negative or greater than the number of 16-bit units in - * <code>data</code> , or if the specified <code>count</code> is - * negative. - * <br> NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. - */ - public void replaceData(int offset, - int count, - String arg) - throws DOMException; - -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * The <code>CharacterData</code> interface extends Node with a set of + * attributes and methods for accessing character data in the DOM. For + * clarity this set is defined here rather than on each object that uses + * these attributes and methods. No DOM objects correspond directly to + * <code>CharacterData</code>, though <code>Text</code> and others do + * inherit the interface from it. All <code>offsets</code> in this interface + * start from <code>0</code>. + * <p>As explained in the <code>DOMString</code> interface, text strings in + * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In + * the following, the term 16-bit units is used whenever necessary to + * indicate that indexing on CharacterData is done in 16-bit units. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public interface CharacterData extends Node { + /** + * The character data of the node that implements this interface. The DOM + * implementation may not put arbitrary limits on the amount of data + * that may be stored in a <code>CharacterData</code> node. However, + * implementation limits may mean that the entirety of a node's data may + * not fit into a single <code>DOMString</code>. In such cases, the user + * may call <code>substringData</code> to retrieve the data in + * appropriately sized pieces. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. + * @exception DOMException + * DOMSTRING_SIZE_ERR: Raised when it would return more characters than + * fit in a <code>DOMString</code> variable on the implementation + * platform. + */ + public String getData() + throws DOMException; + public void setData(String data) + throws DOMException; + + /** + * The number of 16-bit units that are available through <code>data</code> + * and the <code>substringData</code> method below. This may have the + * value zero, i.e., <code>CharacterData</code> nodes may be empty. + */ + public int getLength(); + + /** + * Extracts a range of data from the node. + * @param offsetStart offset of substring to extract. + * @param countThe number of 16-bit units to extract. + * @return The specified substring. If the sum of <code>offset</code> and + * <code>count</code> exceeds the <code>length</code>, then all 16-bit + * units to the end of the data are returned. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is + * negative or greater than the number of 16-bit units in + * <code>data</code>, or if the specified <code>count</code> is + * negative. + * <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does + * not fit into a <code>DOMString</code>. + */ + public String substringData(int offset, + int count) + throws DOMException; + + /** + * Append the string to the end of the character data of the node. Upon + * success, <code>data</code> provides access to the concatenation of + * <code>data</code> and the <code>DOMString</code> specified. + * @param argThe <code>DOMString</code> to append. + * @exception DOMException + * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ + public void appendData(String arg) + throws DOMException; + + /** + * Insert a string at the specified 16-bit unit offset. + * @param offsetThe character offset at which to insert. + * @param argThe <code>DOMString</code> to insert. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is + * negative or greater than the number of 16-bit units in + * <code>data</code>. + * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ + public void insertData(int offset, + String arg) + throws DOMException; + + /** + * Remove a range of 16-bit units from the node. Upon success, + * <code>data</code> and <code>length</code> reflect the change. + * @param offsetThe offset from which to start removing. + * @param countThe number of 16-bit units to delete. If the sum of + * <code>offset</code> and <code>count</code> exceeds + * <code>length</code> then all 16-bit units from <code>offset</code> + * to the end of the data are deleted. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is + * negative or greater than the number of 16-bit units in + * <code>data</code>, or if the specified <code>count</code> is + * negative. + * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ + public void deleteData(int offset, + int count) + throws DOMException; + + /** + * Replace the characters starting at the specified 16-bit unit offset + * with the specified string. + * @param offsetThe offset from which to start replacing. + * @param countThe number of 16-bit units to replace. If the sum of + * <code>offset</code> and <code>count</code> exceeds + * <code>length</code>, then all 16-bit units to the end of the data + * are replaced; (i.e., the effect is the same as a <code>remove</code> + * method call with the same range, followed by an <code>append</code> + * method invocation). + * @param argThe <code>DOMString</code> with which the range must be + * replaced. + * @exception DOMException + * INDEX_SIZE_ERR: Raised if the specified <code>offset</code> is + * negative or greater than the number of 16-bit units in + * <code>data</code>, or if the specified <code>count</code> is + * negative. + * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. + */ + public void replaceData(int offset, + int count, + String arg) + throws DOMException; + +} Index: Comment.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/Comment.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Comment.java 2000/10/30 14:21:14 1.1.1.1 +++ Comment.java 2001/06/15 13:52:36 1.2 @@ -1,24 +1,24 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * This interface inherits from <code>CharacterData</code> and represents the - * content of a comment, i.e., all the characters between the starting ' - * <code><!--</code> ' and ending '<code>--></code> '. Note that this - * is the definition of a comment in XML, and, in practice, HTML, although - * some HTML tools may implement the full SGML comment structure. - */ -public interface Comment extends CharacterData { -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * This interface inherits from <code>CharacterData</code> and represents the + * content of a comment, i.e., all the characters between the starting ' + * <code><!--</code>' and ending '<code>--></code>'. Note that this is + * the definition of a comment in XML, and, in practice, HTML, although some + * HTML tools may implement the full SGML comment structure. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public interface Comment extends CharacterData { +} Index: DOMException.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/DOMException.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- DOMException.java 2000/10/30 14:21:14 1.1.1.1 +++ DOMException.java 2001/06/15 13:52:36 1.2 @@ -1,70 +1,116 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * DOM operations only raise exceptions in "exceptional" circumstances, - * i.e., when an operation is impossible to perform (either for logical - * reasons, because data is lost, or because the implementation has become - * unstable). In general, DOM methods return specific error values in ordinary - * processing situations, such as out-of-bound errors when using - * <code>NodeList</code> . - * <p> Implementations may raise other exceptions under other circumstances. - * For example, implementations may raise an implementation-dependent - * exception if a <code>null</code> argument is passed. - * <p> Some languages and object systems do not support the concept of - * exceptions. For such systems, error conditions may be indicated using - * native error reporting mechanisms. For some bindings, for example, methods - * may return error codes similar to those listed in the corresponding method - * descriptions. - */ -public class DOMException extends RuntimeException { - public DOMException(short code, String message) { - super(message); - this.code = code; - } - public short code; - // ExceptionCode - public static final short INDEX_SIZE_ERR = 1; - public static final short DOMSTRING_SIZE_ERR = 2; - public static final short HIERARCHY_REQUEST_ERR = 3; - public static final short WRONG_DOCUMENT_ERR = 4; - public static final short INVALID_CHARACTER_ERR = 5; - public static final short NO_DATA_ALLOWED_ERR = 6; - public static final short NO_MODIFICATION_ALLOWED_ERR = 7; - public static final short NOT_FOUND_ERR = 8; - public static final short NOT_SUPPORTED_ERR = 9; - public static final short INUSE_ATTRIBUTE_ERR = 10; - /** - * @since DOM Level 2 - */ - public static final short INVALID_STATE_ERR = 11; - /** - * @since DOM Level 2 - */ - public static final short SYNTAX_ERR = 12; - /** - * @since DOM Level 2 - */ - public static final short INVALID_MODIFICATION_ERR = 13; - /** - * @since DOM Level 2 - */ - public static final short NAMESPACE_ERR = 14; - /** - * @since DOM Level 2 - */ - public static final short INVALID_ACCESS_ERR = 15; - -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * DOM operations only raise exceptions in "exceptional" circumstances, i.e., + * when an operation is impossible to perform (either for logical reasons, + * because data is lost, or because the implementation has become unstable). + * In general, DOM methods return specific error values in ordinary + * processing situations, such as out-of-bound errors when using + * <code>NodeList</code>. + * <p>Implementations should raise other exceptions under other circumstances. + * For example, implementations should raise an implementation-dependent + * exception if a <code>null</code> argument is passed. + * <p>Some languages and object systems do not support the concept of + * exceptions. For such systems, error conditions may be indicated using + * native error reporting mechanisms. For some bindings, for example, + * methods may return error codes similar to those listed in the + * corresponding method descriptions. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public class DOMException extends RuntimeException { + public DOMException(short code, String message) { + super(message); + this.code = code; + } + public short code; + // ExceptionCode + /** + * If index or size is negative, or greater than the allowed value + */ + public static final short INDEX_SIZE_ERR = 1; + /** + * If the specified range of text does not fit into a DOMString + */ + public static final short DOMSTRING_SIZE_ERR = 2; + /** + * If any node is inserted somewhere it doesn't belong + */ + public static final short HIERARCHY_REQUEST_ERR = 3; + /** + * If a node is used in a different document than the one that created it + * (that doesn't support it) + */ + public static final short WRONG_DOCUMENT_ERR = 4; + /** + * If an invalid or illegal character is specified, such as in a name. See + * production 2 in the XML specification for the definition of a legal + * character, and production 5 for the definition of a legal name + * character. + */ + public static final short INVALID_CHARACTER_ERR = 5; + /** + * If data is specified for a node which does not support data + */ + public static final short NO_DATA_ALLOWED_ERR = 6; + /** + * If an attempt is made to modify an object where modifications are not + * allowed + */ + public static final short NO_MODIFICATION_ALLOWED_ERR = 7; + /** + * If an attempt is made to reference a node in a context where it does + * not exist + */ + public static final short NOT_FOUND_ERR = 8; + /** + * If the implementation does not support the requested type of object or + * operation. + */ + public static final short NOT_SUPPORTED_ERR = 9; + /** + * If an attempt is made to add an attribute that is already in use + * elsewhere + */ + public static final short INUSE_ATTRIBUTE_ERR = 10; + /** + * If an attempt is made to use an object that is not, or is no longer, + * usable. + * @since DOM Level 2 + */ + public static final short INVALID_STATE_ERR = 11; + /** + * If an invalid or illegal string is specified. + * @since DOM Level 2 + */ + public static final short SYNTAX_ERR = 12; + /** + * If an attempt is made to modify the type of the underlying object. + * @since DOM Level 2 + */ + public static final short INVALID_MODIFICATION_ERR = 13; + /** + * If an attempt is made to create or change an object in a way which is + * incorrect with regard to namespaces. + * @since DOM Level 2 + */ + public static final short NAMESPACE_ERR = 14; + /** + * If a parameter or an operation is not supported by the underlying + * object. + * @since DOM Level 2 + */ + public static final short INVALID_ACCESS_ERR = 15; + +} Index: DOMImplementation.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/DOMImplementation.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- DOMImplementation.java 2000/10/30 14:21:14 1.1.1.1 +++ DOMImplementation.java 2001/06/15 13:52:36 1.2 @@ -1,97 +1,100 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * The <code>DOMImplementation</code> interface provides a number of methods - * for performing operations that are independent of any particular instance - * of the document object model. - */ -public interface DOMImplementation { - /** - * Test if the DOM implementation implements a specific feature. - * @param feature The name of the feature to test (case-insensitive). The - * legal values are defined throughout this specification and listed in - * the section. The name must be an XML name . To avoid possible - * conflicts, as a convention, names referring to features defined - * outside the DOM spec should be made unique by reversing the name of - * the Internet domain name of the person (or the organization that - * person belongs to) who defines the feature, component by component, - * and use this as a prefix. For instance, the W3C SYMM Working Group - * defines the feature "org.w3c.dom.smil". - * @param version This is the version number of the feature to test. In - * Level 2, this is the string "2.0". If the version is not specified, - * supporting any version of the feature causes the method to return - * <code>true</code> . - * @return <code>true</code> if the feature is implemented in the - * specified version, <code>false</code> otherwise. - */ - public boolean hasFeature(String feature, - String version); - - /** - * Creates an empty <code>DocumentType</code> node. Entity declarations - * and notations are not made available. Entity reference expansions and - * default attribute additions do not occur. It is expected that a future - * version of the DOM will provide a way for populating a - * <code>DocumentType</code> . - * <br> HTML-only DOM implementations do not need to implement this method. - * @param qualifiedName The qualified name of the document type to be - * created. - * @param publicId The external subset public identifier. - * @param systemId The external subset system identifier. - * @return A new <code>DocumentType</code> node with - * <code>Node.ownerDocument</code> set to <code>null</code> . - * @exception DOMException - * INVALID_CHARACTER_ERR: Raised if the specified qualified name - * contains an illegal character. - * <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is - * malformed. - * @since DOM Level 2 - */ - public DocumentType createDocumentType(String qualifiedName, - String publicId, - String systemId) - throws DOMException; - - /** - * Creates an XML <code>Document</code> object of the specified type with - * its document element. HTML-only DOM implementations do not need to - * implement this method. - * @param namespaceURI The namespace URI of the document element to - * create, or <code>null</code> . - * @param qualifiedName The qualified name of the document element to be - * created. - * @param doctype The type of document to be created or <code>null</code> - * . When <code>doctype</code> is not <code>null</code> , its - * <code>Node.ownerDocument</code> attribute is set to the document - * being created. - * @return A new <code>Document</code> object. - * @exception DOMException - * INVALID_CHARACTER_ERR: Raised if the specified qualified name - * contains an illegal character. - * <br> NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is - * malformed, or if the <code>qualifiedName</code> has a prefix that is - * "xml" and the <code>namespaceURI</code> is different from - * "http://www.w3.org/XML/1998/namespace". - * <br> WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already - * been used with a different document. - * @since DOM Level 2 - */ - public Document createDocument(String namespaceURI, - String qualifiedName, - DocumentType doctype) - throws DOMException; - -} - +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ + +package org.w3c.dom; + +/** + * The <code>DOMImplementation</code> interface provides a number of methods + * for performing operations that are independent of any particular instance + * of the document object model. + * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>. + */ +public interface DOMImplementation { + /** + * Test if the DOM implementation implements a specific feature. + * @param featureThe name of the feature to test (case-insensitive). The + * values used by DOM features are defined throughout the DOM Level 2 + * specifications and listed in the section. The name must be an XML + * name. To avoid possible conflicts, as a convention, names referring + * to features defined outside the DOM specification should be made + * unique by reversing the name of the Internet domain name of the + * person (or the organization that the person belongs to) who defines + * the feature, component by component, and using this as a prefix. + * For instance, the W3C SVG Working Group defines the feature + * "org.w3c.dom.svg". + * @param versionThis is the version number of the feature to test. In + * Level 2, the string can be either "2.0" or "1.0". If the version is + * not specified, supporting any version of the feature causes the + * method to return <code>true</code>. + * @return <code>true</code> if the feature is implemented in the + * specified version, <code>false</code> otherwise. + */ + public boolean hasFeature(String feature, + String version); + + /** + * Creates an empty <code>DocumentType</code> node. Entity declarations + * and notations are not made available. Entity reference expansions and + * default attribute additions do not occur. It is expected that a + * future version of the DOM will provide a way for populating a + * <code>DocumentType</code>. + * <br>HTML-only DOM implementations do not need to implement this method. + * @param qualifiedNameThe qualified name of the document type to be + * created. + * @param publicIdThe external subset public identifier. + * @param systemIdThe external subset system identifier. + * @return A new <code>DocumentType</code> node with + * <code>Node.ownerDocument</code> set to <code>null</code>. + * @exception DOMException + * INVALID_CHARACTER_ERR: Raised if the specified qualified name + * contains an illegal character. + * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is + * malformed. + * @since DOM Level 2 + */ + public DocumentType createDocumentType(String qualifiedName, + String publicId, + String systemId) + throws DOMException; + + /** + * Creates an XML <code>Document</code> object of the specified type with + * its document element. HTML-only DOM implementations do not need to + * implement this method. + * @param namespaceURIThe namespace URI of the document element to create. + * @param qualifiedNameThe qualified name of the document element to be + * created. + * @param doctypeThe type of document to be created or <code>null</code>. + * When <code>doctype</code> is not <code>null</code>, its + * <code>Node.ownerDocument</code> attribute is set to the document + * being created. + * @return A new <code>Document</code> object. + * @exception DOMException + * INVALID_CHARACTER_ERR: Raised if the specified qualified name + * contains an illegal character. + * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is + * malformed, if the <code>qualifiedName</code> has a prefix and the + * <code>namespaceURI</code> is <code>null</code>, or if the + * <code>qualifiedName</code> has a prefix that is "xml" and the + * <code>namespaceURI</code> is different from " + * http://www.w3.org/XML/1998/namespace" . + * <br>WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already + * been used with a different document or was created from a different + * implementation. + * @since DOM Level 2 + */ + public Document createDocument(String namespaceURI, + String qualifiedName, + DocumentType doctype) + throws DOMException; + +} Index: Document.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/dom/Document.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Document.java 2000/10/30 14:21:15 1.1.1.1 +++ Document.java 2001/06/15 13:52:36 1.2 @@ -1,368 +1,365 @@ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more - * details. - */ - -package org.w3c.dom; - -/** - * The <code>Document</code> interface represents the entire HTML or XML - * document. Conceptually, it is the root of the document tree, and provides - * the primary access to the document's data. - * <p> Since elements, text nodes, comments, processing instructions, etc. - * cannot exist outside the context of a <code>Document</code> , the - * <code>Document</code> interface also contains the factory methods needed - * to create these objects. The <code>Node</code> objects created have a - * <code>ownerDocument</code> attribute which associates them with the - * <code>Document</code> within whose context they were created. - */ -public interface Document extends Node { - /** - * The Document Type Declaration (see <code>DocumentType</code> ) - * associated with this document. For HTML documents as well as XML - * documents without a document type declaration this returns - * <code>null</code> . The DOM Level 2 does not support editing the - * Document Type Declaration, therefore <code>docType</code> cannot be - * altered in any way, including through the use of methods, such as - * <code>insertNode</code> or <code>removeNode</code> , inherited from - * <code>Node</code> . - */ - public DocumentType getDoctype(); - - /** - * The <code>DOMImplementation</code> object that handles this document. - * A DOM application may use objects from multiple implementations. - */ - public DOMImplementation getImplementation(); - - /** - * This is a convenience attribute that allows direct access to the child - * node that is the root element of the document. For HTML documents, - * this is the element with the tagName "HTML". - */ - public Element getDocumentElement(); - - /** - * Creates an element of the type specified. Note that the instance - * returned implements the <code>Element</code> interface, so attributes - * can be specified directly on the returned object. - * <br> In addition, if there are known attributes with default values, - * <code>Attr</code> nodes representing them are automatically created and - * attached to the element. - * <br> To create an element with a qualified name and namespace URI, use - * the <code>createElementNS</code> method. - * @param tagName The name of the element type to instantiate. For XML, - * this is case-sensitive. For HTML, the <code>tagName</code> - * parameter may be provided in any case, but it must be mapped to the - * canonical uppercase form by the DOM implementation. - * @return A new <code>Element</code> object with the - * <code>nodeName</code> attribute set to <code>tagName</code> , and - * <code>localName</code> , <code>prefix</code> , and - * <code>namespaceURI</code> set to <code>null</code> . - * @exception DOMException - * INVALID_CHARACTER_ERR: Raised if the specified name contains an - * illegal character. - */ - public Element createElement(String tagName) - throws DOMException; - - /** - * Creates an empty <code>DocumentFragment</code> object. - * @return A new <code>DocumentFragment</code> . - */ - public DocumentFragment createDocumentFragment(); - - /** - * Creates a <code>Text</code> node given the specified string. - * @param data The data for the node. - * @return The new <code>Text</code> object. - */ - public Text createTextNode(String data); - - /** - * Creates a <code>Comment</code> node given the specified string. - * @param data The data for the node. - * @return The new <code>Comment</code> object. - */ - public Comment createComment(String data); - - /** - * Creates a <code>CDATASection</code> node whose value is the specified - * string. - * @param data The data for the <code>CDATASection</code> contents. - * @return The new <code>CDATASection</code> object. - * @exception DOMException - * NOT_SUPPORTED_ERR: Raised if this document is an HTML document. - */ - public CDATASection createCDATASection(String data) - throws DOMException; - - /** - * Creates a <code>ProcessingInstruction</code> node given the specified - * name and data strings. - * @param target The target part of the processing instruction. - * @param data The data for the node. - * @return The new <code>ProcessingInstruction</code> object. - * @exception DOMException - * INVALID_CHARACTER_ERR: Raised if the specified target contains an - * illegal character. - * <br> NOT_SUPPORTED_ERR: Raised if this document is an HTML document. - */ - public ProcessingInstruction createProcessingInstruction(String target, - String data) - throws DOMException; - - /** - * Creates an <code>Attr</code> of the given name. Note that the - * <code>Attr</code> instance can then be set on an <code>Element</code> - * using the ... [truncated message content] |
From: Troadec P. <Pas...@sr...> - 2001-03-15 15:58:05
|
Hello, I use Jtidy to clean Html page (properties of tidy are : numeric-entities: yes, char-encoding: raw, output-xhtml: yes). I note when i have, in the input html page, a link to a servlet with a parameter name which begins as .."&prop="..., i get the value "0x1d " instead of ..."&prop=" !... Example : - input : --------- ... <a href="http://de.mf.news.yahoo.com/mailto? url=http://de.dir.yahoo.com/Naturwissenschaft_und_Technik/Biologie/ &title=/Naturwissenschaft_und_Technik/Biologie/ &locale=de &prop=dir &rf=f">Kategorie per E-Mail weiterempfehlen</a>... - output : ----------- ... <a href="http://de.mf.news.yahoo.com/mailto? url=http://de.dir.yahoo.com/Naturwissenschaft_und_Technik/Biologie/ &title=/Naturwissenschaft_und_Technik/Biologie/ &locale=de =dir &rf=f"> Kategorie per E-Mail weiterempfehlen </a>... ..."&prop"... would have been transformed in ..."&prop="... and not in value "0x1d "! is there someone that has an idea to resolve this problem? Thanks Pascal Troadec |
From: Sami L. <lem...@us...> - 2001-01-25 21:32:22
|
Update of /cvsroot/jtidy/jtidy In directory usw-pr-cvs1:/tmp/cvs-serv15650 Modified Files: build.xml Log Message: Updated the main target to Ant 1.2. Index: build.xml =================================================================== RCS file: /cvsroot/jtidy/jtidy/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- build.xml 2000/11/03 16:04:55 1.6 +++ build.xml 2001/01/25 21:32:45 1.7 @@ -2,13 +2,15 @@ <!-- ================================================================ Jakarta Ant build file for JTidy. + NOTE: The build.xml file has been updated to Ant 1.2!! + Ant is an all-Java build tool and a replacement for "make". It is particularly useful for building Java projects. If you do not have Ant, get it at http:/jakarta.apache.org/ant/ - This build file is compatible with the stable 1.1 release of Ant. + This build file is compatible with the stable 1.2 release of Ant. ================================================================ --> <project name="JTidy" default="main"> @@ -71,11 +73,11 @@ <delete file="${build.dir}/${name}.jar"/> <!-- Copy the extra files to the build dir. --> - <copyfile src="${src.dir}/org/w3c/tidy/TidyMessages.properties" - dest="${build.dir}/org/w3c/tidy/TidyMessages.properties"/> + <copy file="${src.dir}/org/w3c/tidy/TidyMessages.properties" + tofile="${build.dir}/org/w3c/tidy/TidyMessages.properties"/> - <copyfile src="web/tidy.gif" - dest="${build.dir}/org/w3c/tidy/tidy.gif"/> + <copy file="web/tidy.gif" + tofile="${build.dir}/org/w3c/tidy/tidy.gif"/> <!-- Build the JAR file. --> <jar jarfile="${build.dir}/${name}.jar" @@ -115,8 +117,8 @@ <!-- ================================================================= --> <target name="clean" depends="init"> - <deltree dir="${build.dir}"/> - <deltree dir="${build.javadoc}"/> + <delete dir="${build.dir}"/> + <delete dir="${build.javadoc}"/> </target> <!-- ================================================================ --> |
From: Gary L P. <gar...@us...> - 2000-12-10 02:55:19
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory slayer.i.sourceforge.net:/tmp/cvs-serv22122 Modified Files: DOMNodeImpl.java Log Message: Update hasAttributes to return a value instead of throwing exception. Contributed by dl...@us... Index: DOMNodeImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/DOMNodeImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DOMNodeImpl.java 2000/11/30 21:27:03 1.5 +++ DOMNodeImpl.java 2000/12/10 02:55:16 1.6 @@ -480,11 +480,11 @@ } /** - * DOM2 - not implemented. + * DOM2 - @see org.w3c.dom.Node#hasAttributes + * contributed by dl...@us... */ - public boolean hasAttributes() { - // NOT SUPPORTED - throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, - "Not supported"); + public boolean hasAttributes() + { + return adaptee.attributes != null; } } |
From: Gary L P. <gar...@us...> - 2000-11-30 21:27:13
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory slayer.i.sourceforge.net:/tmp/cvs-serv17835 Modified Files: DOMNodeImpl.java Node.java Added Files: DOMCDATASectionImpl.java Log Message: Add support for CDATASections. --- NEW FILE --- /* * @(#)DOMCDATASectionImpl.java 1.11 2000/08/16 * */ package org.w3c.tidy; import org.w3c.dom.DOMException; /** * * DOMCDATASectionImpl * * (c) 1998-2000 (W3C) MIT, INRIA, Keio University * See Tidy.java for the copyright notice. * Derived from <a href="http://www.w3.org/People/Raggett/tidy"> * HTML Tidy Release 4 Aug 2000</a> * * @author Dave Raggett <ds...@w3...> * @author Andy Quick <ac....@sy...> (translation to Java) * @author Gary L Peskin <ga...@fi...> * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000 */ public class DOMCDATASectionImpl extends DOMTextImpl implements org.w3c.dom.CDATASection { protected DOMCDATASectionImpl(Node adaptee) { super(adaptee); } /* --------------------- DOM ---------------------------- */ /** * @see org.w3c.dom.Node#getNodeName */ public String getNodeName() { return "#cdata-section"; } /** * @see org.w3c.dom.Node#getNodeType */ public short getNodeType() { return org.w3c.dom.Node.CDATA_SECTION_NODE; } } Index: DOMNodeImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/DOMNodeImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- DOMNodeImpl.java 2000/11/14 14:52:18 1.4 +++ DOMNodeImpl.java 2000/11/30 21:27:03 1.5 @@ -47,6 +47,7 @@ { String value = ""; //BAK 10/10/2000 replaced null if (adaptee.type == Node.TextNode || + adaptee.type == Node.CDATATag || adaptee.type == Node.CommentTag || adaptee.type == Node.ProcInsTag) { @@ -67,6 +68,7 @@ public void setNodeValue(String nodeValue) throws DOMException { if (adaptee.type == Node.TextNode || + adaptee.type == Node.CDATATag || adaptee.type == Node.CommentTag || adaptee.type == Node.ProcInsTag) { @@ -107,6 +109,9 @@ case Node.TextNode: result = org.w3c.dom.Node.TEXT_NODE; break; + case Node.CDATATag: + result = org.w3c.dom.Node.CDATA_SECTION_NODE; + break; case Node.StartTag: case Node.StartEndTag: result = org.w3c.dom.Node.ELEMENT_NODE; @@ -233,7 +238,8 @@ if (newCh.adaptee.type != Node.StartTag && newCh.adaptee.type != Node.StartEndTag && newCh.adaptee.type != Node.CommentTag && - newCh.adaptee.type != Node.TextNode) { + newCh.adaptee.type != Node.TextNode && + newCh.adaptee.type != Node.CDATATag) { throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, "newChild cannot be a child of this node"); } @@ -286,7 +292,8 @@ if (newCh.adaptee.type != Node.StartTag && newCh.adaptee.type != Node.StartEndTag && newCh.adaptee.type != Node.CommentTag && - newCh.adaptee.type != Node.TextNode) { + newCh.adaptee.type != Node.TextNode && + newCh.adaptee.type != Node.CDATATag) { throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, "newChild cannot be a child of this node"); } @@ -385,7 +392,8 @@ if (newCh.adaptee.type != Node.StartTag && newCh.adaptee.type != Node.StartEndTag && newCh.adaptee.type != Node.CommentTag && - newCh.adaptee.type != Node.TextNode) { + newCh.adaptee.type != Node.TextNode && + newCh.adaptee.type != Node.CDATATag) { throw new DOMExceptionImpl(DOMException.HIERARCHY_REQUEST_ERR, "newChild cannot be a child of this node"); } Index: Node.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Node.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Node.java 2000/11/14 14:52:18 1.3 +++ Node.java 2000/11/30 21:27:03 1.4 @@ -877,7 +877,10 @@ case TextNode: adapter = new DOMTextImpl(this); break; - case Node.ProcInsTag: + case CDATATag: + adapter = new DOMCDATASectionImpl(this); + break; + case ProcInsTag: adapter = new DOMProcessingInstructionImpl(this); break; default: |
From: Gary L P. <gar...@us...> - 2000-11-21 19:08:25
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory slayer.i.sourceforge.net:/tmp/cvs-serv25928 Modified Files: Clean.java Log Message: Fix for bug 123086 causing StringIndexOutOfBoundsException in Clean.createProps line 156 due to trailing spaces in property name. Index: Clean.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Clean.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Clean.java 2000/10/30 14:21:21 1.1.1.1 +++ Clean.java 2000/11/21 19:08:11 1.2 @@ -153,7 +153,7 @@ ++name_end; } - if (name_end > style.length() || style.charAt(name_end) != ':') + if (name_end >= style.length() || style.charAt(name_end) != ':') break; while (value_start < style.length() && |
Update of /cvsroot/jtidy/jtidy/src/org/xml/sax In directory slayer.i.sourceforge.net:/tmp/cvs-serv31233 Added Files: SAXException.java SAXNotRecognizedException.java SAXNotSupportedException.java SAXParseException.java XMLFilter.java XMLReader.java Log Message: Initial add of SAX classes. --- NEW FILE --- // SAX exception class. // No warranty; no copyright -- use this as you will. // $Id: SAXException.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; /** * Encapsulate a general SAX error or warning. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>This class can contain basic error or warning information from * either the XML parser or the application: a parser writer or * application writer can subclass it to provide additional * functionality. SAX handlers may throw this exception or * any exception subclassed from it.</p> * * <p>If the application needs to pass through other types of * exceptions, it must wrap those exceptions in a SAXException * or an exception derived from a SAXException.</p> * * <p>If the parser or application needs to include information about a * specific location in an XML document, it should use the * {@link org.xml.sax.SAXParseException SAXParseException} subclass.</p> * * @since SAX 1.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.SAXParseException */ public class SAXException extends Exception { /** * Create a new SAXException. * * @param message The error or warning message. * @see org.xml.sax.Parser#setLocale */ public SAXException (String message) { super(message); this.exception = null; } /** * Create a new SAXException wrapping an existing exception. * * <p>The existing exception will be embedded in the new * one, and its message will become the default message for * the SAXException.</p> * * @param e The exception to be wrapped in a SAXException. */ public SAXException (Exception e) { super(); this.exception = e; } /** * Create a new SAXException from an existing exception. * * <p>The existing exception will be embedded in the new * one, but the new exception will have its own message.</p> * * @param message The detail message. * @param e The exception to be wrapped in a SAXException. * @see org.xml.sax.Parser#setLocale */ public SAXException (String message, Exception e) { super(message); this.exception = e; } /** * Return a detail message for this exception. * * <p>If there is an embedded exception, and if the SAXException * has no detail message of its own, this method will return * the detail message from the embedded exception.</p> * * @return The error or warning message. * @see org.xml.sax.Parser#setLocale */ public String getMessage () { String message = super.getMessage(); if (message == null && exception != null) { return exception.getMessage(); } else { return message; } } /** * Return the embedded exception, if any. * * @return The embedded exception, or null if there is none. */ public Exception getException () { return exception; } /** * Override toString to pick up any embedded exception. * * @return A string representation of this exception. */ public String toString () { if (exception != null) { return exception.toString(); } else { return super.toString(); } } ////////////////////////////////////////////////////////////////////// // Internal state. ////////////////////////////////////////////////////////////////////// /** * @serial The embedded exception if tunnelling, or null. */ private Exception exception; } // end of SAXException.java --- NEW FILE --- // SAXNotRecognizedException.java - unrecognized feature or value. // Written by David Megginson, sa...@me... // NO WARRANTY! This class is in the Public Domain. // $Id: SAXNotRecognizedException.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; /** * Exception class for an unrecognized identifier. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>An XMLReader will throw this exception when it finds an * unrecognized feature or property identifier; SAX applications and * extensions may use this class for other, similar purposes.</p> * * @since SAX 2.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.SAXNotSupportedException */ public class SAXNotRecognizedException extends SAXException { /** * Construct a new exception with the given message. * * @param message The text message of the exception. */ public SAXNotRecognizedException (String message) { super(message); } } // end of SAXNotRecognizedException.java --- NEW FILE --- // SAXNotSupportedException.java - unsupported feature or value. // Written by David Megginson, sa...@me... // NO WARRANTY! This class is in the Public Domain. // $Id: SAXNotSupportedException.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; /** * Exception class for an unsupported operation. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>An XMLReader will throw this exception when it recognizes a * feature or property identifier, but cannot perform the requested * operation (setting a state or value). Other SAX2 applications and * extensions may use this class for similar purposes.</p> * * @since SAX 2.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.SAXNotRecognizedException */ public class SAXNotSupportedException extends SAXException { /** * Construct a new exception with the given message. * * @param message The text message of the exception. */ public SAXNotSupportedException (String message) { super(message); } } // end of SAXNotSupportedException.java --- NEW FILE --- // SAX exception class. // No warranty; no copyright -- use this as you will. // $Id: SAXParseException.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; /** * Encapsulate an XML parse error or warning. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>This exception will include information for locating the error * in the original XML document. Note that although the application * will receive a SAXParseException as the argument to the handlers * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, * the application is not actually required to throw the exception; * instead, it can simply read the information in it and take a * different action.</p> * * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException * SAXException}, it inherits the ability to wrap another exception.</p> * * @since SAX 1.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.SAXException * @see org.xml.sax.Locator * @see org.xml.sax.ErrorHandler */ public class SAXParseException extends SAXException { ////////////////////////////////////////////////////////////////////// // Constructors. ////////////////////////////////////////////////////////////////////// /** * Create a new SAXParseException from a message and a Locator. * * <p>This constructor is especially useful when an application is * creating its own exception from within a {@link org.xml.sax.ContentHandler * ContentHandler} callback.</p> * * @param message The error or warning message. * @param locator The locator object for the error or warning (may be * null). * @see org.xml.sax.Locator * @see org.xml.sax.Parser#setLocale */ public SAXParseException (String message, Locator locator) { super(message); if (locator != null) { init(locator.getPublicId(), locator.getSystemId(), locator.getLineNumber(), locator.getColumnNumber()); } else { init(null, null, -1, -1); } } /** * Wrap an existing exception in a SAXParseException. * * <p>This constructor is especially useful when an application is * creating its own exception from within a {@link org.xml.sax.ContentHandler * ContentHandler} callback, and needs to wrap an existing exception that is not a * subclass of {@link org.xml.sax.SAXException SAXException}.</p> * * @param message The error or warning message, or null to * use the message from the embedded exception. * @param locator The locator object for the error or warning (may be * null). * @param e Any exception. * @see org.xml.sax.Locator * @see org.xml.sax.Parser#setLocale */ public SAXParseException (String message, Locator locator, Exception e) { super(message, e); if (locator != null) { init(locator.getPublicId(), locator.getSystemId(), locator.getLineNumber(), locator.getColumnNumber()); } else { init(null, null, -1, -1); } } /** * Create a new SAXParseException. * * <p>This constructor is most useful for parser writers.</p> * * <p>If the system identifier is a URL, the parser must resolve it * fully before creating the exception.</p> * * @param message The error or warning message. * @param publicId The public identifer of the entity that generated * the error or warning. * @param systemId The system identifer of the entity that generated * the error or warning. * @param lineNumber The line number of the end of the text that * caused the error or warning. * @param columnNumber The column number of the end of the text that * cause the error or warning. * @see org.xml.sax.Parser#setLocale */ public SAXParseException (String message, String publicId, String systemId, int lineNumber, int columnNumber) { super(message); init(publicId, systemId, lineNumber, columnNumber); } /** * Create a new SAXParseException with an embedded exception. * * <p>This constructor is most useful for parser writers who * need to wrap an exception that is not a subclass of * {@link org.xml.sax.SAXException SAXException}.</p> * * <p>If the system identifier is a URL, the parser must resolve it * fully before creating the exception.</p> * * @param message The error or warning message, or null to use * the message from the embedded exception. * @param publicId The public identifer of the entity that generated * the error or warning. * @param systemId The system identifer of the entity that generated * the error or warning. * @param lineNumber The line number of the end of the text that * caused the error or warning. * @param columnNumber The column number of the end of the text that * cause the error or warning. * @param e Another exception to embed in this one. * @see org.xml.sax.Parser#setLocale */ public SAXParseException (String message, String publicId, String systemId, int lineNumber, int columnNumber, Exception e) { super(message, e); init(publicId, systemId, lineNumber, columnNumber); } /** * Internal initialization method. * * @param publicId The public identifier of the entity which generated the exception, * or null. * @param systemId The system identifier of the entity which generated the exception, * or null. * @param lineNumber The line number of the error, or -1. * @param columnNumber The column number of the error, or -1. */ private void init (String publicId, String systemId, int lineNumber, int columnNumber) { this.publicId = publicId; this.systemId = systemId; this.lineNumber = lineNumber; this.columnNumber = columnNumber; } /** * Get the public identifier of the entity where the exception occurred. * * @return A string containing the public identifier, or null * if none is available. * @see org.xml.sax.Locator#getPublicId */ public String getPublicId () { return this.publicId; } /** * Get the system identifier of the entity where the exception occurred. * * <p>If the system identifier is a URL, it will be resolved * fully.</p> * * @return A string containing the system identifier, or null * if none is available. * @see org.xml.sax.Locator#getSystemId */ public String getSystemId () { return this.systemId; } /** * The line number of the end of the text where the exception occurred. * * @return An integer representing the line number, or -1 * if none is available. * @see org.xml.sax.Locator#getLineNumber */ public int getLineNumber () { return this.lineNumber; } /** * The column number of the end of the text where the exception occurred. * * <p>The first column in a line is position 1.</p> * * @return An integer representing the column number, or -1 * if none is available. * @see org.xml.sax.Locator#getColumnNumber */ public int getColumnNumber () { return this.columnNumber; } ////////////////////////////////////////////////////////////////////// // Internal state. ////////////////////////////////////////////////////////////////////// /** * @serial The public identifier, or null. * @see #getPublicId */ private String publicId; /** * @serial The system identifier, or null. * @see #getSystemId */ private String systemId; /** * @serial The line number, or -1. * @see #getLineNumber */ private int lineNumber; /** * @serial The column number, or -1. * @see #getColumnNumber */ private int columnNumber; } // end of SAXParseException.java --- NEW FILE --- // XMLFilter.java - filter SAX2 events. // Written by David Megginson, sa...@me... // NO WARRANTY! This class is in the Public Domain. // $Id: XMLFilter.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; /** * Interface for an XML filter. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>An XML filter is like an XML reader, except that it obtains its * events from another XML reader rather than a primary source like * an XML document or database. Filters can modify a stream of * events as they pass on to the final application.</p> * * <p>The XMLFilterImpl helper class provides a convenient base * for creating SAX2 filters, by passing on all {@link org.xml.sax.EntityResolver * EntityResolver}, {@link org.xml.sax.DTDHandler DTDHandler}, * {@link org.xml.sax.ContentHandler ContentHandler} and {@link org.xml.sax.ErrorHandler * ErrorHandler} events automatically.</p> * * @since SAX 2.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.helpers.XMLFilterImpl */ public interface XMLFilter extends XMLReader { /** * Set the parent reader. * * <p>This method allows the application to link the filter to * a parent reader (which may be another filter). The argument * may not be null.</p> * * @param parent The parent reader. */ public abstract void setParent (XMLReader parent); /** * Get the parent reader. * * <p>This method allows the application to query the parent * reader (which may be another filter). It is generally a * bad idea to perform any operations on the parent reader * directly: they should all pass through this filter.</p> * * @return The parent filter, or null if none has been set. */ public abstract XMLReader getParent (); } // end of XMLFilter.java --- NEW FILE --- // XMLReader.java - read an XML document. // Written by David Megginson, sa...@me... // NO WARRANTY! This class is in the Public Domain. // $Id: XMLReader.java,v 1.1 2000/11/14 16:49:04 garypeskin Exp $ package org.xml.sax; import java.io.IOException; /** * Interface for reading an XML document using callbacks. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p><strong>Note:</strong> despite its name, this interface does * <em>not</em> extend the standard Java {@link java.io.Reader Reader} * interface, because reading XML is a fundamentally different activity * than reading character data.</p> * * <p>XMLReader is the interface that an XML parser's SAX2 driver must * implement. This interface allows an application to set and * query features and properties in the parser, to register * event handlers for document processing, and to initiate * a document parse.</p> * * <p>All SAX interfaces are assumed to be synchronous: the * {@link #parse parse} methods must not return until parsing * is complete, and readers must wait for an event-handler callback * to return before reporting the next event.</p> * * <p>This interface replaces the (now deprecated) SAX 1.0 {@link * org.xml.sax.Parser Parser} interface. The XMLReader interface * contains two important enhancements over the old Parser * interface:</p> * * <ol> * <li>it adds a standard way to query and set features and * properties; and</li> * <li>it adds Namespace support, which is required for many * higher-level XML standards.</li> * </ol> * * <p>There are adapters available to convert a SAX1 Parser to * a SAX2 XMLReader and vice-versa.</p> * * @since SAX 2.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.XMLFilter * @see org.xml.sax.helpers.ParserAdapter * @see org.xml.sax.helpers.XMLReaderAdapter */ public interface XMLReader { //////////////////////////////////////////////////////////////////// // Configuration. //////////////////////////////////////////////////////////////////// /** * Look up the value of a feature. * * <p>The feature name is any fully-qualified URI. It is * possible for an XMLReader to recognize a feature name but * to be unable to return its value; this is especially true * in the case of an adapter for a SAX1 Parser, which has * no way of knowing whether the underlying parser is * performing validation or expanding external entities.</p> * * <p>All XMLReaders are required to recognize the * http://xml.org/sax/features/namespaces and the * http://xml.org/sax/features/namespace-prefixes feature names.</p> * * <p>Some feature values may be available only in specific * contexts, such as before, during, or after a parse.</p> * * <p>Typical usage is something like this:</p> * * <pre> * XMLReader r = new MySAXDriver(); * * // try to activate validation * try { * r.setFeature("http://xml.org/sax/features/validation", true); * } catch (SAXException e) { * System.err.println("Cannot activate validation."); * } * * // register event handlers * r.setContentHandler(new MyContentHandler()); * r.setErrorHandler(new MyErrorHandler()); * * // parse the first document * try { * r.parse("http://www.foo.com/mydoc.xml"); * } catch (IOException e) { * System.err.println("I/O exception reading XML document"); * } catch (SAXException e) { * System.err.println("XML exception reading document."); * } * </pre> * * <p>Implementors are free (and encouraged) to invent their own features, * using names built on their own URIs.</p> * * @param name The feature name, which is a fully-qualified URI. * @return The current state of the feature (true or false). * @exception org.xml.sax.SAXNotRecognizedException When the * XMLReader does not recognize the feature name. * @exception org.xml.sax.SAXNotSupportedException When the * XMLReader recognizes the feature name but * cannot determine its value at this time. * @see #setFeature */ public boolean getFeature (String name) throws SAXNotRecognizedException, SAXNotSupportedException; /** * Set the state of a feature. * * <p>The feature name is any fully-qualified URI. It is * possible for an XMLReader to recognize a feature name but * to be unable to set its value; this is especially true * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser Parser}, * which has no way of affecting whether the underlying parser is * validating, for example.</p> * * <p>All XMLReaders are required to support setting * http://xml.org/sax/features/namespaces to true and * http://xml.org/sax/features/namespace-prefixes to false.</p> * * <p>Some feature values may be immutable or mutable only * in specific contexts, such as before, during, or after * a parse.</p> * * @param name The feature name, which is a fully-qualified URI. * @param state The requested state of the feature (true or false). * @exception org.xml.sax.SAXNotRecognizedException When the * XMLReader does not recognize the feature name. * @exception org.xml.sax.SAXNotSupportedException When the * XMLReader recognizes the feature name but * cannot set the requested value. * @see #getFeature */ public void setFeature (String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException; /** * Look up the value of a property. * * <p>The property name is any fully-qualified URI. It is * possible for an XMLReader to recognize a property name but * to be unable to return its state; this is especially true * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser * Parser}.</p> * * <p>XMLReaders are not required to recognize any specific * property names, though an initial core set is documented for * SAX2.</p> * * <p>Some property values may be available only in specific * contexts, such as before, during, or after a parse.</p> * * <p>Implementors are free (and encouraged) to invent their own properties, * using names built on their own URIs.</p> * * @param name The property name, which is a fully-qualified URI. * @return The current value of the property. * @exception org.xml.sax.SAXNotRecognizedException When the * XMLReader does not recognize the property name. * @exception org.xml.sax.SAXNotSupportedException When the * XMLReader recognizes the property name but * cannot determine its value at this time. * @see #setProperty */ public Object getProperty (String name) throws SAXNotRecognizedException, SAXNotSupportedException; /** * Set the value of a property. * * <p>The property name is any fully-qualified URI. It is * possible for an XMLReader to recognize a property name but * to be unable to set its value; this is especially true * in the case of an adapter for a SAX1 {@link org.xml.sax.Parser * Parser}.</p> * * <p>XMLReaders are not required to recognize setting * any specific property names, though a core set is provided with * SAX2.</p> * * <p>Some property values may be immutable or mutable only * in specific contexts, such as before, during, or after * a parse.</p> * * <p>This method is also the standard mechanism for setting * extended handlers.</p> * * @param name The property name, which is a fully-qualified URI. * @param state The requested value for the property. * @exception org.xml.sax.SAXNotRecognizedException When the * XMLReader does not recognize the property name. * @exception org.xml.sax.SAXNotSupportedException When the * XMLReader recognizes the property name but * cannot set the requested value. */ public void setProperty (String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException; //////////////////////////////////////////////////////////////////// // Event handlers. //////////////////////////////////////////////////////////////////// /** * Allow an application to register an entity resolver. * * <p>If the application does not register an entity resolver, * the XMLReader will perform its own default resolution.</p> * * <p>Applications may register a new or different resolver in the * middle of a parse, and the SAX parser must begin using the new * resolver immediately.</p> * * @param resolver The entity resolver. * @exception java.lang.NullPointerException If the resolver * argument is null. * @see #getEntityResolver */ public void setEntityResolver (EntityResolver resolver); /** * Return the current entity resolver. * * @return The current entity resolver, or null if none * has been registered. * @see #setEntityResolver */ public EntityResolver getEntityResolver (); /** * Allow an application to register a DTD event handler. * * <p>If the application does not register a DTD handler, all DTD * events reported by the SAX parser will be silently ignored.</p> * * <p>Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately.</p> * * @param handler The DTD handler. * @exception java.lang.NullPointerException If the handler * argument is null. * @see #getDTDHandler */ public void setDTDHandler (DTDHandler handler); /** * Return the current DTD handler. * * @return The current DTD handler, or null if none * has been registered. * @see #setDTDHandler */ public DTDHandler getDTDHandler (); /** * Allow an application to register a content event handler. * * <p>If the application does not register a content handler, all * content events reported by the SAX parser will be silently * ignored.</p> * * <p>Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately.</p> * * @param handler The content handler. * @exception java.lang.NullPointerException If the handler * argument is null. * @see #getContentHandler */ public void setContentHandler (ContentHandler handler); /** * Return the current content handler. * * @return The current content handler, or null if none * has been registered. * @see #setContentHandler */ public ContentHandler getContentHandler (); /** * Allow an application to register an error event handler. * * <p>If the application does not register an error handler, all * error events reported by the SAX parser will be silently * ignored; however, normal processing may not continue. It is * highly recommended that all SAX applications implement an * error handler to avoid unexpected bugs.</p> * * <p>Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately.</p> * * @param handler The error handler. * @exception java.lang.NullPointerException If the handler * argument is null. * @see #getErrorHandler */ public void setErrorHandler (ErrorHandler handler); /** * Return the current error handler. * * @return The current error handler, or null if none * has been registered. * @see #setErrorHandler */ public ErrorHandler getErrorHandler (); //////////////////////////////////////////////////////////////////// // Parsing. //////////////////////////////////////////////////////////////////// /** * Parse an XML document. * * <p>The application can use this method to instruct the XML * reader to begin parsing an XML document from any valid input * source (a character stream, a byte stream, or a URI).</p> * * <p>Applications may not invoke this method while a parse is in * progress (they should create a new XMLReader instead for each * nested XML document). Once a parse is complete, an * application may reuse the same XMLReader object, possibly with a * different input source.</p> * * <p>During the parse, the XMLReader will provide information * about the XML document through the registered event * handlers.</p> * * <p>This method is synchronous: it will not return until parsing * has ended. If a client application wants to terminate * parsing early, it should throw an exception.</p> * * @param source The input source for the top-level of the * XML document. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @exception java.io.IOException An IO exception from the parser, * possibly from a byte stream or character stream * supplied by the application. * @see org.xml.sax.InputSource * @see #parse(java.lang.String) * @see #setEntityResolver * @see #setDTDHandler * @see #setContentHandler * @see #setErrorHandler */ public void parse (InputSource input) throws IOException, SAXException; /** * Parse an XML document from a system identifier (URI). * * <p>This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact * equivalent of the following:</p> * * <pre> * parse(new InputSource(systemId)); * </pre> * * <p>If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser.</p> * * @param systemId The system identifier (URI). * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @exception java.io.IOException An IO exception from the parser, * possibly from a byte stream or character stream * supplied by the application. * @see #parse(org.xml.sax.InputSource) */ public void parse (String systemId) throws IOException, SAXException; } // end of XMLReader.java |
From: Gary L P. <gar...@us...> - 2000-11-14 14:52:22
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory slayer.i.sourceforge.net:/tmp/cvs-serv17830 Modified Files: DOMNodeImpl.java Node.java Log Message: Bugfix for bug 122047. When a child is added to a DOM node created with tag=XmlTags and the type is StartEndTag, change the type to StartTag so that the child will show up in PPrint. When the last child is removed, from such a node change type back to StartEndTag. Index: DOMNodeImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/DOMNodeImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DOMNodeImpl.java 2000/11/09 18:54:20 1.3 +++ DOMNodeImpl.java 2000/11/14 14:52:18 1.4 @@ -240,6 +240,10 @@ } if (refChild == null) { Node.insertNodeAtEnd(this.adaptee, newCh.adaptee); + if (this.adaptee.tag == TagTable.xmlTags + && this.adaptee.type == Node.StartEndTag) { + this.adaptee.setType(Node.StartTag); + } } else { Node ref = this.adaptee.content; while (ref != null) { @@ -346,6 +350,12 @@ } Node.discardElement(ref); + if (this.adaptee.content == null + && this.adaptee.tag == TagTable.xmlTags + && this.adaptee.type == Node.StartTag) { + this.adaptee.setType(Node.StartEndTag); + } + return oldChild; } @@ -381,6 +391,11 @@ } } Node.insertNodeAtEnd(this.adaptee, newCh.adaptee); + + if (this.adaptee.tag == TagTable.xmlTags && this.adaptee.type == Node.StartEndTag) { + this.adaptee.setType(Node.StartTag); + } + return newChild; } Index: Node.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/Node.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Node.java 2000/11/01 08:32:20 1.2 +++ Node.java 2000/11/14 14:52:18 1.3 @@ -902,6 +902,13 @@ } return node; } + + + protected void setType(short newType) + { + this.type = newType; + } + /* --------------------- END DOM ------------------------ */ } |
From: Gary L P. <gar...@us...> - 2000-11-09 18:54:23
|
Update of /cvsroot/jtidy/jtidy/src/org/w3c/tidy In directory slayer.i.sourceforge.net:/tmp/cvs-serv31366 Modified Files: DOMNodeImpl.java Log Message: Add methods to support DOM Level 2. Index: DOMNodeImpl.java =================================================================== RCS file: /cvsroot/jtidy/jtidy/src/org/w3c/tidy/DOMNodeImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DOMNodeImpl.java 2000/11/01 08:32:20 1.2 +++ DOMNodeImpl.java 2000/11/09 18:54:20 1.3 @@ -414,7 +414,7 @@ */ public boolean supports(String feature, String version) { - return false; + return isSupported(feature, version); } /** @@ -430,7 +430,7 @@ */ public String getPrefix() { - return null; + return null; } /** @@ -446,7 +446,22 @@ */ public String getLocalName() { - return null; + return null; + } + + /** + * DOM2 - not implemented. + */ + public boolean isSupported(String feature,String version) { + return false; } + /** + * DOM2 - not implemented. + */ + public boolean hasAttributes() { + // NOT SUPPORTED + throw new DOMExceptionImpl(DOMException.NO_MODIFICATION_ALLOWED_ERR, + "Not supported"); + } } |
From: Gary L P. <gar...@us...> - 2000-11-09 18:04:45
|
Update of /cvsroot/jtidy/jtidy/src/org/xml/sax In directory slayer.i.sourceforge.net:/tmp/cvs-serv26459 Removed Files: Test01.java Log Message: Remove module used for testing syncmail. --- Test01.java DELETED --- |
From: Gary L P. <gar...@us...> - 2000-11-07 05:29:59
|
Update of /cvsroot/jtidy/jtidy/src/org/xml/sax In directory slayer.i.sourceforge.net:/tmp/cvs-serv31535 Added Files: Parser.java Log Message: Initial add of SAX classes --- NEW FILE --- // SAX parser interface. // No warranty; no copyright -- use this as you will. // $Id: Parser.java,v 1.1 2000/11/07 05:29:52 garypeskin Exp $ package org.xml.sax; import java.io.IOException; import java.util.Locale; /** * Basic interface for SAX (Simple API for XML) parsers. * * <blockquote> * <em>This module, both source code and documentation, is in the * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> * </blockquote> * * <p>This was the main event supplier interface for SAX1; it has * been replaced in SAX2 by {@link org.xml.sax.XMLReader XMLReader}, * which includes Namespace support and sophisticated configurability * and extensibility.</p> * * <p>All SAX1 parsers must implement this basic interface: it allows * applications to register handlers for different types of events * and to initiate a parse from a URI, or a character stream.</p> * * <p>All SAX1 parsers must also implement a zero-argument constructor * (though other constructors are also allowed).</p> * * <p>SAX1 parsers are reusable but not re-entrant: the application * may reuse a parser object (possibly with a different input source) * once the first parse has completed successfully, but it may not * invoke the parse() methods recursively within a parse.</p> * * @deprecated This interface has been replaced by the SAX2 * {@link org.xml.sax.XMLReader XMLReader} * interface, which includes Namespace support. * @since SAX 1.0 * @author David Megginson, * <a href="mailto:sa...@me...">sa...@me...</a> * @version 2.0 * @see org.xml.sax.EntityResolver * @see org.xml.sax.DTDHandler * @see org.xml.sax.DocumentHandler * @see org.xml.sax.ErrorHandler * @see org.xml.sax.HandlerBase * @see org.xml.sax.InputSource */ public interface Parser { /** * Allow an application to request a locale for errors and warnings. * * <p>SAX parsers are not required to provide localisation for errors * and warnings; if they cannot support the requested locale, * however, they must throw a SAX exception. Applications may * not request a locale change in the middle of a parse.</p> * * @param locale A Java Locale object. * @exception org.xml.sax.SAXException Throws an exception * (using the previous or default locale) if the * requested locale is not supported. * @see org.xml.sax.SAXException * @see org.xml.sax.SAXParseException */ public abstract void setLocale (Locale locale) throws SAXException; /** * Allow an application to register a custom entity resolver. * * <p>If the application does not register an entity resolver, the * SAX parser will resolve system identifiers and open connections * to entities itself (this is the default behaviour implemented in * HandlerBase).</p> * * <p>Applications may register a new or different entity resolver * in the middle of a parse, and the SAX parser must begin using * the new resolver immediately.</p> * * @param resolver The object for resolving entities. * @see EntityResolver * @see HandlerBase */ public abstract void setEntityResolver (EntityResolver resolver); /** * Allow an application to register a DTD event handler. * * <p>If the application does not register a DTD handler, all DTD * events reported by the SAX parser will be silently * ignored (this is the default behaviour implemented by * HandlerBase).</p> * * <p>Applications may register a new or different * handler in the middle of a parse, and the SAX parser must * begin using the new handler immediately.</p> * * @param handler The DTD handler. * @see DTDHandler * @see HandlerBase */ public abstract void setDTDHandler (DTDHandler handler); /** * Allow an application to register a document event handler. * * <p>If the application does not register a document handler, all * document events reported by the SAX parser will be silently * ignored (this is the default behaviour implemented by * HandlerBase).</p> * * <p>Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately.</p> * * @param handler The document handler. * @see DocumentHandler * @see HandlerBase */ public abstract void setDocumentHandler (DocumentHandler handler); /** * Allow an application to register an error event handler. * * <p>If the application does not register an error event handler, * all error events reported by the SAX parser will be silently * ignored, except for fatalError, which will throw a SAXException * (this is the default behaviour implemented by HandlerBase).</p> * * <p>Applications may register a new or different handler in the * middle of a parse, and the SAX parser must begin using the new * handler immediately.</p> * * @param handler The error handler. * @see ErrorHandler * @see SAXException * @see HandlerBase */ public abstract void setErrorHandler (ErrorHandler handler); /** * Parse an XML document. * * <p>The application can use this method to instruct the SAX parser * to begin parsing an XML document from any valid input * source (a character stream, a byte stream, or a URI).</p> * * <p>Applications may not invoke this method while a parse is in * progress (they should create a new Parser instead for each * additional XML document). Once a parse is complete, an * application may reuse the same Parser object, possibly with a * different input source.</p> * * @param source The input source for the top-level of the * XML document. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @exception java.io.IOException An IO exception from the parser, * possibly from a byte stream or character stream * supplied by the application. * @see org.xml.sax.InputSource * @see #parse(java.lang.String) * @see #setEntityResolver * @see #setDTDHandler * @see #setDocumentHandler * @see #setErrorHandler */ public abstract void parse (InputSource source) throws SAXException, IOException; /** * Parse an XML document from a system identifier (URI). * * <p>This method is a shortcut for the common case of reading a * document from a system identifier. It is the exact * equivalent of the following:</p> * * <pre> * parse(new InputSource(systemId)); * </pre> * * <p>If the system identifier is a URL, it must be fully resolved * by the application before it is passed to the parser.</p> * * @param systemId The system identifier (URI). * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @exception java.io.IOException An IO exception from the parser, * possibly from a byte stream or character stream * supplied by the application. * @see #parse(org.xml.sax.InputSource) */ public abstract void parse (String systemId) throws SAXException, IOException; } // end of Parser.java |
From: Gary L P. <gar...@us...> - 2000-11-07 05:29:20
|
Update of /cvsroot/jtidy/CVSROOT In directory slayer.i.sourceforge.net:/tmp/cvs-serv31499 Modified Files: syncmail Log Message: Reduce sleep time. Return to update. This will cause an error message at the client but all will be okay. Index: syncmail =================================================================== RCS file: /cvsroot/jtidy/CVSROOT/syncmail,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- syncmail 2000/11/07 05:19:21 1.27 +++ syncmail 2000/11/07 05:29:18 1.28 @@ -88,8 +88,8 @@ if os.path.exists(file): fp = open(file) else: - update_cmd = 'cvs -fn checkout -r %s -p %s' % (newrev, file) - time.sleep(15) + update_cmd = 'cvs -fn update -r %s -p %s' % (newrev, file) + time.sleep(5) fp = os.popen(update_cmd) lines = fp.readlines() fp.close() |
From: Gary L P. <gar...@us...> - 2000-11-07 05:21:41
|
Update of /cvsroot/jtidy/jtidy/src/org/xml/sax In directory slayer.i.sourceforge.net:/tmp/cvs-serv31064 Added Files: Locator.java Log Message: Initial add of SAX classes --- NEW FILE --- |