XMLParser
public XMLParser(InputStream in,
String systemId,
boolean validating,
boolean namespaceAware,
boolean coalescing,
boolean replaceERefs,
boolean externalEntities,
boolean supportDTD,
boolean baseAware,
boolean stringInterning,
boolean extendedEventTypes,
XMLReporter reporter,
XMLResolver resolver)
Creates a new XML parser for the given input stream.
This constructor should be used where possible, as it allows the
encoding of the XML data to be correctly determined from the stream.
in
- the input streamsystemId
- the URL from which the input stream was retrieved
(necessary if there are external entities to be resolved)validating
- if the parser is to be a validating parsernamespaceAware
- if the parser should support XML Namespacescoalescing
- if CDATA sections should be merged into adjacent text
nodesreplaceERefs
- if entity references should be automatically
replaced by their replacement text (otherwise they will be reported as
entity-reference events)externalEntities
- if external entities should be loadedsupportDTD
- if support for the XML DTD should be enabledbaseAware
- if the parser should support XML Base to resolve
external entitiesstringInterning
- whether strings will be interned during parsingreporter
- the reporter to receive warnings during processingresolver
- the callback interface used to resolve external
entities
XMLParser
public XMLParser(Reader reader,
String systemId,
boolean validating,
boolean namespaceAware,
boolean coalescing,
boolean replaceERefs,
boolean externalEntities,
boolean supportDTD,
boolean baseAware,
boolean stringInterning,
boolean extendedEventTypes,
XMLReporter reporter,
XMLResolver resolver)
Creates a new XML parser for the given character stream.
This constructor is only available for compatibility with the JAXP
APIs, which permit XML to be parsed from a character stream. Because
the encoding specified by the character stream may conflict with that
specified in the XML declaration, this method should be avoided where
possible.
systemId
- the URL from which the input stream was retrieved
(necessary if there are external entities to be resolved)validating
- if the parser is to be a validating parsernamespaceAware
- if the parser should support XML Namespacescoalescing
- if CDATA sections should be merged into adjacent text
nodesreplaceERefs
- if entity references should be automatically
replaced by their replacement text (otherwise they will be reported as
entity-reference events)externalEntities
- if external entities should be loadedsupportDTD
- if support for the XML DTD should be enabledbaseAware
- if the parser should support XML Base to resolve
external entitiesstringInterning
- whether strings will be interned during parsingreporter
- the reporter to receive warnings during processingresolver
- the callback interface used to resolve external
entities
absolutize
public static String absolutize(String base,
String href)
"Absolutize" a URL. This resolves a relative URL into an absolute one.
base
- the current base URLhref
- the (absolute or relative) URL to resolve
isChar
public static boolean isChar(int c)
Indicates whether the specified Unicode character matches the Char
production.
isCombiningChar
public static boolean isCombiningChar(int c)
Indicates whether the specified Unicode character matches the
CombiningChar production.
isDigit
public static boolean isDigit(int c)
Indicates whether the specified Unicode character matches the Digit
production.
isExtender
public static boolean isExtender(int c)
Indicates whether the specified Unicode character matches the Extender
production.
isLetter
public static boolean isLetter(int c)
Indicates whether the specified Unicode character matches the Letter
production.
isNameCharacter
public static boolean isNameCharacter(int c,
boolean xml11)
Indicates whether the specified Unicode character is a Name non-initial
character.
isNameStartCharacter
public static boolean isNameStartCharacter(int c,
boolean xml11)
Indicates whether the specified Unicode character is a Name start
character.
isXML11Char
public static boolean isXML11Char(int c)
Indicates whether the specified Unicode character is an XML 1.1 Char.
isXML11RestrictedChar
public static boolean isXML11RestrictedChar(int c)
Indicates whether the specified Unicode character is an XML 1.1
RestrictedChar.
main
public static void main(String[] args)
throws Exception
Simple test harness for reading an XML file.
args[0] is the filename of the XML file
If args[1] is "-x", enable XInclude processing
XMLParser.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath 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 the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
Partly derived from code which carried the following notice:
Copyright (c) 1997, 1998 by Microstar Software Ltd.
AElfred is free for both commercial and non-commercial use and
redistribution, provided that Microstar's copyright and disclaimer are
retained intact. You are free to modify AElfred for your own use and
to redistribute AElfred with your modifications, provided that the
modifications are clearly documented.
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. Please use it AT
YOUR OWN RISK.