Java Doc for Purifier.java in  » HTML-Parser » nekohtml » org » cyberneko » html » filters » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » HTML Parser » nekohtml » org.cyberneko.html.filters 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cyberneko.html.filters.DefaultFilter
      org.cyberneko.html.filters.Purifier

Purifier
public class Purifier extends DefaultFilter (Code)
This filter purifies the HTML input to ensure XML well-formedness. The purification process includes:
  • fixing illegal characters in the document, including
    • element and attribute names,
    • processing instruction target and data,
    • document text;
  • ensuring the string "--" does not appear in the content of a comment;
  • ensuring the string "]]>" does not appear in the content of a CDATA section;
  • ensuring that the XML declaration has required pseudo-attributes and that the values are correct; and
  • synthesized missing namespace bindings.

Illegal characters in XML names are converted to the character sequence "_u####_" where "####" is the value of the Unicode character represented in hexadecimal. Whereas illegal characters appearing in document content is converted to the character sequence "\\u####".

In comments, the character '-' is replaced by the character sequence "- " to prevent "--" from ever appearing in the comment content. For CDATA sections, the character ']' is replaced by the character sequence "] " to prevent "]]" from appearing.

The URI used for synthesized namespace bindings is "http://cyberneko.org/html/ns/synthesized/number" where number is generated to ensure uniqueness.
author:
   Andy Clark
version:
   $Id: Purifier.java,v 1.5 2005/02/14 03:56:54 andyc Exp $



Field Summary
final protected static  StringAUGMENTATIONS
     Include infoset augmentations.
final protected static  StringNAMESPACES
     Namespaces.
final protected static  HTMLEventInfoSYNTHESIZED_ITEM
     Synthesized event info item.
final public static  StringSYNTHESIZED_NAMESPACE_PREFX
     Synthesized namespace binding prefix.
protected  booleanfAugmentations
     Augmentations.
protected  booleanfInCDATASection
     True if inside a CDATA section.
protected  NamespaceContextfNamespaceContext
     Namespace information.
protected  booleanfNamespaces
     Namespaces.
protected  StringfPublicId
     Public identifier of doctype declaration.
protected  booleanfSeenDoctype
     True if the doctype declaration was seen.
protected  booleanfSeenRootElement
     True if root element was seen.
protected  intfSynthesizedNamespaceCount
     Synthesized namespace binding count.
protected  StringfSystemId
     System identifier of doctype declaration.


Method Summary
public  voidcharacters(XMLString text, Augmentations augs)
     Characters.
public  voidcomment(XMLString text, Augmentations augs)
     Comment.
public  voiddoctypeDecl(String root, String pubid, String sysid, Augmentations augs)
     Doctype declaration.
public  voidemptyElement(QName element, XMLAttributes attrs, Augmentations augs)
     Empty element.
public  voidendCDATA(Augmentations augs)
     End CDATA section.
public  voidendElement(QName element, Augmentations augs)
     End element.
protected  voidhandleStartDocument()
     Handle start document.
protected  voidhandleStartElement(QName element, XMLAttributes attrs)
     Handle start element.
public  voidprocessingInstruction(String target, XMLString data, Augmentations augs)
     Processing instruction.
protected  StringpurifyName(String name, boolean localpart)
     Purify name.
protected  QNamepurifyQName(QName qname)
     Purify qualified name.
protected  XMLStringpurifyText(XMLString text)
     Purify content.
public  voidreset(XMLComponentManager manager)
    
public  voidstartCDATA(Augmentations augs)
     Start CDATA section.
public  voidstartDocument(XMLLocator locator, String encoding, Augmentations augs)
     Start document.
public  voidstartDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs)
     Start document.
public  voidstartElement(QName element, XMLAttributes attrs, Augmentations augs)
     Start element.
protected  voidsynthesizeBinding(XMLAttributes attrs, String ns)
     Synthesize namespace binding.
final protected  AugmentationssynthesizedAugs()
     Returns an augmentations object with a synthesized item added.
protected static  StringtoHexString(int c, int padlen)
     Returns a padded hexadecimal string for the given value.
public  voidxmlDecl(String version, String encoding, String standalone, Augmentations augs)
     XML declaration.

Field Detail
AUGMENTATIONS
final protected static String AUGMENTATIONS(Code)
Include infoset augmentations.



NAMESPACES
final protected static String NAMESPACES(Code)
Namespaces.



SYNTHESIZED_ITEM
final protected static HTMLEventInfo SYNTHESIZED_ITEM(Code)
Synthesized event info item.



SYNTHESIZED_NAMESPACE_PREFX
final public static String SYNTHESIZED_NAMESPACE_PREFX(Code)
Synthesized namespace binding prefix.



fAugmentations
protected boolean fAugmentations(Code)
Augmentations.



fInCDATASection
protected boolean fInCDATASection(Code)
True if inside a CDATA section.



fNamespaceContext
protected NamespaceContext fNamespaceContext(Code)
Namespace information.



fNamespaces
protected boolean fNamespaces(Code)
Namespaces.



fPublicId
protected String fPublicId(Code)
Public identifier of doctype declaration.



fSeenDoctype
protected boolean fSeenDoctype(Code)
True if the doctype declaration was seen.



fSeenRootElement
protected boolean fSeenRootElement(Code)
True if root element was seen.



fSynthesizedNamespaceCount
protected int fSynthesizedNamespaceCount(Code)
Synthesized namespace binding count.



fSystemId
protected String fSystemId(Code)
System identifier of doctype declaration.





Method Detail
characters
public void characters(XMLString text, Augmentations augs) throws XNIException(Code)
Characters.



comment
public void comment(XMLString text, Augmentations augs) throws XNIException(Code)
Comment.



doctypeDecl
public void doctypeDecl(String root, String pubid, String sysid, Augmentations augs) throws XNIException(Code)
Doctype declaration.



emptyElement
public void emptyElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException(Code)
Empty element.



endCDATA
public void endCDATA(Augmentations augs) throws XNIException(Code)
End CDATA section.



endElement
public void endElement(QName element, Augmentations augs) throws XNIException(Code)
End element.



handleStartDocument
protected void handleStartDocument()(Code)
Handle start document.



handleStartElement
protected void handleStartElement(QName element, XMLAttributes attrs)(Code)
Handle start element.



processingInstruction
public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code)
Processing instruction.



purifyName
protected String purifyName(String name, boolean localpart)(Code)
Purify name.



purifyQName
protected QName purifyQName(QName qname)(Code)
Purify qualified name.



purifyText
protected XMLString purifyText(XMLString text)(Code)
Purify content.



reset
public void reset(XMLComponentManager manager) throws XMLConfigurationException(Code)



startCDATA
public void startCDATA(Augmentations augs) throws XNIException(Code)
Start CDATA section.



startDocument
public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code)
Start document.



startDocument
public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException(Code)
Start document.



startElement
public void startElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException(Code)
Start element.



synthesizeBinding
protected void synthesizeBinding(XMLAttributes attrs, String ns)(Code)
Synthesize namespace binding.



synthesizedAugs
final protected Augmentations synthesizedAugs()(Code)
Returns an augmentations object with a synthesized item added.



toHexString
protected static String toHexString(int c, int padlen)(Code)
Returns a padded hexadecimal string for the given value.



xmlDecl
public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code)
XML declaration.



Fields inherited from org.cyberneko.html.filters.DefaultFilter
protected XMLDocumentHandler fDocumentHandler(Code)(Java Doc)
protected XMLDocumentSource fDocumentSource(Code)(Java Doc)

Methods inherited from org.cyberneko.html.filters.DefaultFilter
public void characters(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc)
public void comment(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc)
public void doctypeDecl(String root, String publicId, String systemId, Augmentations augs) throws XNIException(Code)(Java Doc)
public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc)
public void endCDATA(Augmentations augs) throws XNIException(Code)(Java Doc)
public void endDocument(Augmentations augs) throws XNIException(Code)(Java Doc)
public void endElement(QName element, Augmentations augs) throws XNIException(Code)(Java Doc)
public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code)(Java Doc)
public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException(Code)(Java Doc)
public XMLDocumentHandler getDocumentHandler()(Code)(Java Doc)
public XMLDocumentSource getDocumentSource()(Code)(Java Doc)
public Boolean getFeatureDefault(String featureId)(Code)(Java Doc)
public Object getPropertyDefault(String propertyId)(Code)(Java Doc)
public String[] getRecognizedFeatures()(Code)(Java Doc)
public String[] getRecognizedProperties()(Code)(Java Doc)
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc)
protected static String[] merge(String[] array1, String[] array2)(Code)(Java Doc)
public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code)(Java Doc)
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)(Java Doc)
public void setDocumentHandler(XMLDocumentHandler handler)(Code)(Java Doc)
public void setDocumentSource(XMLDocumentSource source)(Code)(Java Doc)
public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)(Java Doc)
public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc)
public void startCDATA(Augmentations augs) throws XNIException(Code)(Java Doc)
public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException(Code)(Java Doc)
public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc)
public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc)
public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc)
public void startPrefixMapping(String prefix, String uri, Augmentations augs) throws XNIException(Code)(Java Doc)
public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc)
public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.