/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/util/XMLUtilities.html
HTML | 289 lines | 242 code | 37 blank | 10 comment | 0 complexity | 7d6333e20af6a47269628f96856fe1fc MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:14:17 GMT-08:00 2008 -->
- <TITLE>
- XMLUtilities (jEdit API)
- </TITLE>
- <META NAME="keywords" CONTENT="org.gjt.sp.util.XMLUtilities class">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" >
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XMLUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/gjt/sp/util/WorkThreadProgressListener.html" title="interface in org.gjt.sp.util"><B>PREV CLASS</B></A>
- NEXT CLASS</FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/gjt/sp/util/XMLUtilities.html" target="_top"><B>FRAMES</B></A>
- <A HREF="XMLUtilities.html" target="_top"><B>NO FRAMES</B></A>
-
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- org.gjt.sp.util</FONT>
- <BR>
- Class XMLUtilities</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.util.XMLUtilities</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>XMLUtilities</B><DT>extends java.lang.Object</DL>
- </PRE>
- <P>
- XML utility methods that only depend on the JDK.
- <P>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>4.3pre6</DD>
- </DL>
- <HR>
- <P>
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static java.lang.String</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/gjt/sp/util/XMLUtilities.html#charsToEntities(java.lang.String, boolean)">charsToEntities</A></B>(java.lang.String str,
- boolean xml11)</CODE>
- <BR>
- Converts <, >, & in the string to their HTML entity
- equivalents.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static org.xml.sax.InputSource</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/gjt/sp/util/XMLUtilities.html#findEntity(java.lang.String, java.lang.String, java.lang.Class)">findEntity</A></B>(java.lang.String systemId,
- java.lang.String test,
- java.lang.Class where)</CODE>
- <BR>
- Tries to find the given systemId in the context of the given
- class.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/gjt/sp/util/XMLUtilities.html#parseXML(java.io.InputStream, org.xml.sax.helpers.DefaultHandler)">parseXML</A></B>(java.io.InputStream in,
- org.xml.sax.helpers.DefaultHandler handler)</CODE>
- <BR>
- Convenience method for parsing an XML file.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="charsToEntities(java.lang.String, boolean)"><!-- --></A><H3>
- charsToEntities</H3>
- <PRE>
- public static java.lang.String <B>charsToEntities</B>(java.lang.String str,
- boolean xml11)</PRE>
- <DL>
- <DD>Converts <, >, & in the string to their HTML entity
- equivalents.
- <p>If <code>xml11</code> is true, then character entities
- are used to convert illegal XML characters (mainly ASCII
- control characters).</p>
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>str</CODE> - The string<DD><CODE>xml11</CODE> - Whether to allow XML 1.1 constructs.</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="parseXML(java.io.InputStream, org.xml.sax.helpers.DefaultHandler)"><!-- --></A><H3>
- parseXML</H3>
- <PRE>
- public static boolean <B>parseXML</B>(java.io.InputStream in,
- org.xml.sax.helpers.DefaultHandler handler)
- throws java.io.IOException</PRE>
- <DL>
- <DD>Convenience method for parsing an XML file. This method will
- wrap the resource in an InputSource and set the source's
- systemId to "jedit.jar" (so the source should be able to
- handle any external entities by itself).
- <p>SAX Errors are caught and are not propagated to the caller;
- instead, an error message is printed to jEdit's activity
- log. So, if you need custom error handling, <b>do not use
- this method</b>.
- <p>The given stream is closed before the method returns,
- regardless whether there were errors or not.</p>
- <P>
- <DD><DL>
- <DT><B>Returns:</B><DD>true if any error occured during parsing, false if success.
- <DT><B>Throws:</B>
- <DD><CODE>java.io.IOException</CODE></DL>
- </DD>
- </DL>
- <HR>
- <A NAME="findEntity(java.lang.String, java.lang.String, java.lang.Class)"><!-- --></A><H3>
- findEntity</H3>
- <PRE>
- public static org.xml.sax.InputSource <B>findEntity</B>(java.lang.String systemId,
- java.lang.String test,
- java.lang.Class where)</PRE>
- <DL>
- <DD>Tries to find the given systemId in the context of the given
- class. If the given systemId ends with the given test string,
- then try to load a resource using the Class's
- <code>getResourceAsStream()</code> method using the test string
- as the resource.
- <p>This is used a lot internally while parsing XML files used
- by jEdit, but anyone is free to use the method if it sounds
- usable.</p>
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/XMLUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/gjt/sp/util/WorkThreadProgressListener.html" title="interface in org.gjt.sp.util"><B>PREV CLASS</B></A>
- NEXT CLASS</FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/gjt/sp/util/XMLUtilities.html" target="_top"><B>FRAMES</B></A>
- <A HREF="XMLUtilities.html" target="_top"><B>NO FRAMES</B></A>
-
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- </BODY>
- </HTML>